diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-03-10 16:41:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 08:41:44 +0100 |
commit | 700cb587303461d5a96456c56902cfdd8ad50e2d (patch) | |
tree | e13d8e0d750d2a3e5c4d308ff659243f55327143 /Lib/json/tool.py | |
parent | b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 (diff) | |
download | cpython-git-700cb587303461d5a96456c56902cfdd8ad50e2d.tar.gz |
bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779)
Diffstat (limited to 'Lib/json/tool.py')
-rw-r--r-- | Lib/json/tool.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/json/tool.py b/Lib/json/tool.py index 6d7d9a002e..5dee0a744b 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py @@ -72,4 +72,7 @@ def main(): if __name__ == '__main__': - main() + try: + main() + except BrokenPipeError as exc: + sys.exit(exc.errno) |