From: Filipe LaĆ­ns Date: Fri, 13 Oct 2023 05:49:55 +0000 (+0100) Subject: GH-110786: suppress BrokenPipeError on the sysconfig CLI (#110791) X-Git-Tag: v3.13.0a1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6478dea3c8aca7147d013d6d7f5bf7805b300589;p=thirdparty%2FPython%2Fcpython.git GH-110786: suppress BrokenPipeError on the sysconfig CLI (#110791) --- diff --git a/Lib/sysconfig/__main__.py b/Lib/sysconfig/__main__.py index e0c375696969..d7257b9d2d00 100644 --- a/Lib/sysconfig/__main__.py +++ b/Lib/sysconfig/__main__.py @@ -242,4 +242,7 @@ def _main(): if __name__ == '__main__': - _main() + try: + _main() + except BrokenPipeError: + pass diff --git a/Misc/NEWS.d/next/Library/2023-10-13-01-31-27.gh-issue-110786.sThp-A.rst b/Misc/NEWS.d/next/Library/2023-10-13-01-31-27.gh-issue-110786.sThp-A.rst new file mode 100644 index 000000000000..7dab38db11b0 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-10-13-01-31-27.gh-issue-110786.sThp-A.rst @@ -0,0 +1,2 @@ +:mod:`sysconfig`'s CLI now ignores :exc:`BrokenPipeError`, making it exit +normally if its output is being piped and the pipe closes.