Skip to content

Commit 1acb988

Browse files
committed
Remove redundant py2 if clauses
1 parent f70929d commit 1acb988

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

odml/dtypes.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,13 @@ def set(value, dtype=None):
147147
"""
148148
if not dtype:
149149
return str_set(value)
150+
150151
if dtype.endswith("-tuple"):
151152
return tuple_set(value)
152-
if sys.version_info > (3, 0):
153-
if isinstance(value, str):
154-
return str_set(value)
155-
else:
156-
if isinstance(value, str):
157-
return str_set(value)
153+
154+
if isinstance(value, str):
155+
return str_set(value)
156+
158157
return self.get(dtype + "_set", str_set)(value)
159158

160159

odml/tools/xmlparser.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,7 @@ def parse_tag(self, root, fmt, insert_children=True):
449449
self.error("Invalid element <%s> in odML document section <%s> "
450450
% (node.tag, root.tag), node)
451451

452-
if sys.version_info > (3,):
453-
check_args = dict(list(arguments.items()) + list(extra_args.items()))
454-
else:
455-
check_args = dict(arguments.items() + extra_args.items())
456-
452+
check_args = dict(list(arguments.items()) + list(extra_args.items()))
457453
self.check_mandatory_arguments(check_args, fmt, root.tag, root)
458454

459455
# Instantiate the current odML object with the parsed attributes.

0 commit comments

Comments
 (0)