#16476: Fix json.tool to avoid including trailing whitespace.

This commit is contained in:
Ezio Melotti 2012-11-29 02:22:49 +02:00
parent d8feba904c
commit def6ee5979
3 changed files with 12 additions and 9 deletions

View file

@ -31,7 +31,8 @@ def main():
except ValueError, 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')