From 2e0050046dc4c35508758669ec02b5f8c8b091cf Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sun, 29 Mar 2009 21:38:28 +0000 Subject: http://bugs.python.org/issue5381 ordered_pairs_hook backport to simplejson git-svn-id: http://simplejson.googlecode.com/svn/trunk@178 a4795897-2c25-0410-b006-0d3caba88fa1 --- simplejson/tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'simplejson/tool.py') diff --git a/simplejson/tool.py b/simplejson/tool.py index 9044331..b3d47ed 100644 --- a/simplejson/tool.py +++ b/simplejson/tool.py @@ -11,7 +11,7 @@ Usage:: """ import sys -import simplejson +import simplejson as json def main(): if len(sys.argv) == 1: @@ -26,10 +26,10 @@ def main(): else: raise SystemExit(sys.argv[0] + " [infile [outfile]]") try: - obj = simplejson.load(infile) + obj = json.load(infile, object_pairs_hook=json.OrderedDict) except ValueError, e: raise SystemExit(e) - simplejson.dump(obj, outfile, sort_keys=True, indent=4) + json.dump(obj, outfile, sort_keys=True, indent=4) outfile.write('\n') -- cgit v1.2.1