aboutsummaryrefslogtreecommitdiffstats
path: root/json_diff.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-11-21 15:54:09 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-11-21 17:16:22 +0100
commit197ea8be5a2fb5e55083113a3225d6fa12371e24 (patch)
tree91fefdc545018790834c616333f2c82fa1ec573a /json_diff.py
parent793f46ddd47b8b78123fcfa68b62d377380bd366 (diff)
downloadjson_diff-0.9.1.tar.gz
Two small nits in __main__ part.0.9.1
Diffstat (limited to 'json_diff.py')
-rwxr-xr-xjson_diff.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/json_diff.py b/json_diff.py
index 978b0de..8cda9fd 100755
--- a/json_diff.py
+++ b/json_diff.py
@@ -317,12 +317,12 @@ if __name__ == "__main__":
if len(args) != 2:
parser.error("Script requires two positional arguments, names for old and new JSON file.")
- diff = Comparator(file(args[0]), file(args[1]), options.include, options.exclude)
+ diff = Comparator(open(args[0]), open(args[1]), options.include, options.exclude)
if options.HTMLoutput:
diff_res = diff.compare_dicts()
# logging.debug("diff_res:\n%s", json.dumps(diff_res, indent=True))
print(HTMLFormatter(diff_res))
else:
- outs = json.dumps(diff.compare_dicts(), indent=4, ensure_ascii=False).encode("utf-8")
+ outs = json.dumps(diff.compare_dicts(), indent=4, ensure_ascii=False)
outs = "\n".join([line for line in outs.split("\n")])
- print(outs)
+ print(outs.encode("utf-8"))