]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-110786: suppress BrokenPipeError on the sysconfig CLI (#110791)
authorFilipe Laíns <lains@riseup.net>
Fri, 13 Oct 2023 05:49:55 +0000 (06:49 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Oct 2023 05:49:55 +0000 (06:49 +0100)
Lib/sysconfig/__main__.py
Misc/NEWS.d/next/Library/2023-10-13-01-31-27.gh-issue-110786.sThp-A.rst [new file with mode: 0644]

index e0c375696969a5045e4e1362d5a2c15d8100ec0c..d7257b9d2d00db34411d8f9ac6b0bca312d4c819 100644 (file)
@@ -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 (file)
index 0000000..7dab38d
--- /dev/null
@@ -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.