Commit 959ba78d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Arnaud Fontaine

WIP: py2/py3: BusinessTemplate.py.

parent b604f760
......@@ -93,6 +93,10 @@ from difflib import unified_diff
import posixpath
import transaction
import inspect
if six.PY2:
BufferedReader = file
else:
from io import BufferedReader
import threading
from ZODB.broken import Broken, BrokenModified
......@@ -918,7 +922,7 @@ class ObjectTemplateItem(BaseTemplateItem):
else:
connection = self.getConnection(self.aq_parent)
__traceback_info__ = 'Importing %s' % file_name
if hasattr(cache_database, 'db') and isinstance(file_obj, file):
if hasattr(cache_database, 'db') and isinstance(file_obj, BufferedReader):
obj = connection.importFile(self._compileXML(file_obj))
else:
# FIXME: Why not use the importXML function directly? Are there any BT5s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment