8000 bpo-33927: Add support for same infile and outfile to json.tool by remilapeyre · Pull Request #7865 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-33927: Add support for same infile and outfile to json.tool #7865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Prev Previous commit
Next Next commit
Fix indentation level
  • Loading branch information
Rémi Lapeyre committed Feb 26, 2019
commit e7c868efb5a27d1e1c73f56da57cb18469ca70d3
14 changes: 7 additions & 7 deletions Lib/json/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import sys

def _read(infile, json_lines):
try:
if json_lines:
return (json.loads(line) for line in infile)
else:
return (json.load(infile), )
except ValueError as e:
raise SystemExit(e)
try:
if json_lines:
return (json.loads(line) for line in infile)
else:
return (json.load(infile), )
except ValueError as e:
raise SystemExit(e)

def _open_outfile(outfile, parser):
try:
Expand Down
0