From 700cb587303461d5a96456c56902cfdd8ad50e2d Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Tue, 10 Mar 2020 16:41:44 +0900 Subject: bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779) --- Lib/json/tool.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/json/tool.py') 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) -- cgit v1.2.1