mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#16476: Fix json.tool to avoid including trailing whitespace.
This commit is contained in:
parent
d8feba904c
commit
def6ee5979
3 changed files with 12 additions and 9 deletions
|
@ -19,19 +19,19 @@ class TestTool(unittest.TestCase):
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"blorpie"
|
"blorpie"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"whoops"
|
"whoops"
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
"d-shtaeou",
|
"d-shtaeou",
|
||||||
"d-nthiouh",
|
"d-nthiouh",
|
||||||
"i-vhbjkhnth",
|
"i-vhbjkhnth",
|
||||||
{
|
{
|
||||||
"nifty": 87
|
"nifty": 87
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"field": "yes",
|
"field": "yes",
|
||||||
"morefield": false
|
"morefield": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -31,7 +31,8 @@ def main():
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
raise SystemExit(e)
|
raise SystemExit(e)
|
||||||
with outfile:
|
with outfile:
|
||||||
json.dump(obj, outfile, sort_keys=True, indent=4)
|
json.dump(obj, outfile, sort_keys=True,
|
||||||
|
indent=4, separators=(',', ': '))
|
||||||
outfile.write('\n')
|
outfile.write('\n')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #16476: Fix json.tool to avoid including trailing whitespace.
|
||||||
|
|
||||||
- Issue #1160: Fix compiling large regular expressions on UCS2 builds.
|
- Issue #1160: Fix compiling large regular expressions on UCS2 builds.
|
||||||
Patch by Serhiy Storchaka.
|
Patch by Serhiy Storchaka.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue