summaryrefslogtreecommitdiff
path: root/simplejson/tool.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2009-03-29 21:38:28 +0000
committerBob Ippolito <bob@redivi.com>2009-03-29 21:38:28 +0000
commit2e0050046dc4c35508758669ec02b5f8c8b091cf (patch)
tree01e8e8d8c1d63b211c106d7a7e02c717d0eb191d /simplejson/tool.py
parent0d9f46d682a4af5fff44c1d3b01fe2ff00599ec3 (diff)
downloadsimplejson-2e0050046dc4c35508758669ec02b5f8c8b091cf.tar.gz
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
Diffstat (limited to 'simplejson/tool.py')
-rw-r--r--simplejson/tool.py6
1 files changed, 3 insertions, 3 deletions
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')