From c6b607d4a9e4d60fb506034ce67fc89734bb68a7 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 2 May 2009 12:36:44 +0000 Subject: port simplejson upgrade from the trunk #4136 json also now works only with unicode strings Patch by Antoine Pitrou; updated by me --- Lib/json/tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/json/tool.py') diff --git a/Lib/json/tool.py b/Lib/json/tool.py index cec29b6cc6..6d6558acaf 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py @@ -2,11 +2,11 @@ r"""Command-line tool to validate and pretty-print JSON Usage:: - $ echo '{"json":"obj"}' | python -mjson.tool + $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -mjson.tool + $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) """ @@ -24,7 +24,7 @@ def main(): infile = open(sys.argv[1], 'rb') outfile = open(sys.argv[2], 'wb') else: - raise SystemExit("{0} [infile [outfile]]".format(sys.argv[0])) + raise SystemExit(sys.argv[0] + " [infile [outfile]]") try: obj = json.load(infile) except ValueError as e: -- cgit v1.2.1