summaryrefslogtreecommitdiffstats
path: root/Lib/json
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-03-10 07:41:44 (GMT)
committerGitHub <noreply@github.com>2020-03-10 07:41:44 (GMT)
commit700cb587303461d5a96456c56902cfdd8ad50e2d (patch)
treee13d8e0d750d2a3e5c4d308ff659243f55327143 /Lib/json
parentb4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 (diff)
downloadcpython-700cb587303461d5a96456c56902cfdd8ad50e2d.zip
cpython-700cb587303461d5a96456c56902cfdd8ad50e2d.tar.gz
cpython-700cb587303461d5a96456c56902cfdd8ad50e2d.tar.bz2
bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779)
Diffstat (limited to 'Lib/json')
-rw-r--r--Lib/json/tool.py5
1 files changed, 4 insertions, 1 deletions
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 @@ def main():
if __name__ == '__main__':
- main()
+ try:
+ main()
+ except BrokenPipeError as exc:
+ sys.exit(exc.errno)