mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
merge json library with simplejson 2.0.9 (issue 4136)
This commit is contained in:
parent
277859d591
commit
d914e3f861
13 changed files with 2430 additions and 582 deletions
|
@ -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, e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue