commit | 700cb587303461d5a96456c56902cfdd8ad50e2d | [log] [tgz] |
---|---|---|
author | Dong-hee Na <donghee.na92@gmail.com> | Tue Mar 10 16:41:44 2020 +0900 |
committer | GitHub <noreply@github.com> | Tue Mar 10 08:41:44 2020 +0100 |
tree | e13d8e0d750d2a3e5c4d308ff659243f55327143 | |
parent | b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 [diff] [blame] |
bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779)
diff --git a/Lib/json/tool.py b/Lib/json/tool.py index 6d7d9a0..5dee0a7 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py
@@ -72,4 +72,7 @@ if __name__ == '__main__': - main() + try: + main() + except BrokenPipeError as exc: + sys.exit(exc.errno)