summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe LaĆ­ns <lains@riseup.net>2023-10-13 05:49:55 (GMT)
committerGitHub <noreply@github.com>2023-10-13 05:49:55 (GMT)
commit6478dea3c8aca7147d013d6d7f5bf7805b300589 (patch)
treebbf0e4644c22e24a2045e189c58e328a6f5cac32
parentb883cad06b12443014d57dcebd42d55f559b18f4 (diff)
downloadcpython-6478dea3c8aca7147d013d6d7f5bf7805b300589.zip
cpython-6478dea3c8aca7147d013d6d7f5bf7805b300589.tar.gz
cpython-6478dea3c8aca7147d013d6d7f5bf7805b300589.tar.bz2
GH-110786: suppress BrokenPipeError on the sysconfig CLI (#110791)
-rw-r--r--Lib/sysconfig/__main__.py5
-rw-r--r--Misc/NEWS.d/next/Library/2023-10-13-01-31-27.gh-issue-110786.sThp-A.rst2
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/sysconfig/__main__.py b/Lib/sysconfig/__main__.py
index e0c3756..d7257b9 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 0000000..7dab38d
--- /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.