Skip to content

Commit 7614561

Browse files
committed
[tools/versionConv] utf-8 encode only with py3
1 parent 04b408f commit 7614561

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

odml/tools/version_converter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def _parse_xml(self):
5353
doc = doc.replace(elem, val)
5454

5555
# Make sure encoding is present for the xml parser
56-
doc = doc.encode('utf-8')
56+
if sys.version_info.major > 2:
57+
doc = doc.encode('utf-8')
5758

5859
# Make pretty print available by resetting format
5960
parser = ET.XMLParser(remove_blank_text=True)

0 commit comments

Comments
 (0)