From cce7a6609160306f142af325085382b6daa33820 Mon Sep 17 00:00:00 2001 From: "Jakub T. Jankiewicz" Date: Tue, 14 Nov 2023 19:53:48 +0100 Subject: [PATCH 1/2] Ignore BrokenPipeError exception --- codespell_lib/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codespell_lib/__main__.py b/codespell_lib/__main__.py index 0a8630df52..e0dc149ae2 100644 --- a/codespell_lib/__main__.py +++ b/codespell_lib/__main__.py @@ -5,5 +5,7 @@ if __name__ == "__main__": try: sys.exit(_script_main()) + except BrokenPipeError: + pass except KeyboardInterrupt: pass From aaaecc11b5570fd8eb8f85695add506e15ef1817 Mon Sep 17 00:00:00 2001 From: "Jakub T. Jankiewicz" Date: Tue, 14 Nov 2023 21:26:44 +0100 Subject: [PATCH 2/2] small refactor --- codespell_lib/__main__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/codespell_lib/__main__.py b/codespell_lib/__main__.py index e0dc149ae2..c93f3972b9 100644 --- a/codespell_lib/__main__.py +++ b/codespell_lib/__main__.py @@ -5,7 +5,5 @@ if __name__ == "__main__": try: sys.exit(_script_main()) - except BrokenPipeError: - pass - except KeyboardInterrupt: + except (KeyboardInterrupt, BrokenPipeError): pass