Skip to content

Commit 007e023

Browse files
committed
Remove py2 specific encode usage
1 parent 1410828 commit 007e023

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

odml/property.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ def odml_tuple_import(t_count, new_value):
4343
n_val_str += str(tuple_val) + "; "
4444
return_value += [n_val_str[:-2] + ")"]
4545
else:
46-
# non-unicode handling needed for python2
47-
# if len(n_val) != 1 and not isinstance(n_val[0], unicode):
48-
# n_val = n_val.encode('utf-8')
4946
cln = n_val.strip()
5047
br_check = cln.count("(") == cln.count(")")
5148
sep_check = t_count == 1 or cln.count("(") == (cln.count(";") / (t_count - 1))

odml/tools/converters/version_converter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,6 @@ def write_to_file(self, filename, backend="XML"):
518518
:param backend: Format of the source file, default is XML.
519519
"""
520520
data = self.convert(backend)
521-
if sys.version_info < (3,):
522-
data = data.encode('utf-8')
523521

524522
ext = [".xml", ".odml"]
525523
if not filename.endswith(tuple(ext)):

odml/tools/odmlparser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ def to_string(self, odml_document, **kwargs):
124124
string_doc = json.dumps(odml_output, indent=4,
125125
cls=JSONDateTimeSerializer)
126126

127-
if sys.version_info.major < 3:
128-
string_doc = string_doc.encode("utf-8")
129-
130127
return string_doc
131128

132129

0 commit comments

Comments
 (0)