summaryrefslogtreecommitdiffstats
path: root/Lib/json/tool.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-29 00:25:03 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-29 00:25:03 (GMT)
commitb32512ed9a1ab9912a9e0bdbb609ca1a19949355 (patch)
tree0a50a9693de2d3048a93189ac4d26b9f875ca0e4 /Lib/json/tool.py
parent057bcb4c6c7eef93066002db7ab486f12d50ccee (diff)
downloadcpython-b32512ed9a1ab9912a9e0bdbb609ca1a19949355.zip
cpython-b32512ed9a1ab9912a9e0bdbb609ca1a19949355.tar.gz
cpython-b32512ed9a1ab9912a9e0bdbb609ca1a19949355.tar.bz2
#16476: Fix json.tool to avoid including trailing whitespace.
Diffstat (limited to 'Lib/json/tool.py')
-rw-r--r--Lib/json/tool.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/json/tool.py b/Lib/json/tool.py
index 9ab6d65..0f108c6 100644
--- a/Lib/json/tool.py
+++ b/Lib/json/tool.py
@@ -31,7 +31,8 @@ def main():
except ValueError as e:
raise SystemExit(e)
with outfile:
- json.dump(obj, outfile, sort_keys=True, indent=4)
+ json.dump(obj, outfile, sort_keys=True,
+ indent=4, separators=(',', ': '))
outfile.write('\n')