X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=test%2Fjson-compare.py;h=f91530ebd1472d48e20f2a901e52301aa74ee146;hb=9d16ec755c9754fe1f79fe55ab719a7f8578ce37;hp=cb5cee64b223eb6717237d20228bedf6aef3d9fb;hpb=8ef778c8431c17d970b2667943c6ea13c3770912;p=jansson.git diff --git a/test/json-compare.py b/test/json-compare.py index cb5cee6..f91530e 100755 --- a/test/json-compare.py +++ b/test/json-compare.py @@ -1,7 +1,15 @@ #!/usr/bin/python +# +# Copyright (c) 2009 Petri Lehtinen +# +# Jansson is free software; you can redistribute it and/or modify +# it under the terms of the MIT license. See LICENSE for details. -import simplejson import sys +try: + import json +except ImportError: + import simplejson as json def load(filename): try: @@ -12,14 +20,14 @@ def load(filename): sys.exit(1) try: - json = simplejson.load(jsonfile) + jsondata = json.load(jsonfile) except ValueError, err: print "%s is malformed: %s" % (filename, err) sys.exit(1) finally: jsonfile.close() - return json + return jsondata def main(): if len(sys.argv) != 3: