Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
First step to Python3 compatibility with 2to3
Browse files Browse the repository at this point in the history
  • Loading branch information
Domme, Sergej committed Sep 10, 2015
1 parent 4390b25 commit 10e078a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/python/yamlreader/yamlreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def data_merge(a, b):
raise YamlReaderError('Cannot merge non-dict "%s" into dict "%s"' % (b, a))
else:
raise YamlReaderError('NOT IMPLEMENTED "%s" into "%s"' % (b, a))
except TypeError, e:
except TypeError as e:
raise YamlReaderError('TypeError "%s" in key "%s" when merging "%s" into "%s"' % (e, key, b, a))
return a

Expand Down Expand Up @@ -105,7 +105,7 @@ def yaml_load(source, defaultdata=NO_DEFAULT):
logger.debug("YAML LOAD: %s" % new_data)
finally:
f.close()
except MarkedYAMLError, e:
except MarkedYAMLError as e:
logger.error("YAML Error: %s" % str(e))
raise YamlReaderError("YAML Error: %s" % str(e))
if new_data is not None:
Expand Down Expand Up @@ -139,7 +139,7 @@ def __main():
try:
print safe_dump(yaml_load(args, defaultdata={}),
indent=4, default_flow_style=False, canonical=False)
except Exception, e:
except Exception as e:
parser.error(e)

if __name__ == "__main__":
Expand Down

0 comments on commit 10e078a

Please sign in to comment.