commit | caec8a0dfbed04bdb8567782fdff7537529d2232 | [log] [tgz] |
---|---|---|
author | Dong-hee Na <donghee.na92@gmail.com> | Tue Mar 10 17:14:08 2020 +0900 |
committer | GitHub <noreply@github.com> | Tue Mar 10 01:14:08 2020 -0700 |
tree | d7d0b1526d12604386cce861c1d2932ab70a36be | |
parent | cadfe52a006abb46ea0948c6ae2e006064b4a091 [diff] [blame] |
[3.8] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18894) (cherry picked from commit 700cb587303461d5a96456c56902cfdd8ad50e2d) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> Automerge-Triggered-By: @vstinner
diff --git a/Lib/json/tool.py b/Lib/json/tool.py index 8db9ea4..c42138a 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py
@@ -52,4 +52,7 @@ if __name__ == '__main__': - main() + try: + main() + except BrokenPipeError as exc: + sys.exit(exc.errno)