Skip to content

Commit 6478dea

Browse files
authored
pythonGH-110786: suppress BrokenPipeError on the sysconfig CLI (python#110791)
1 parent b883cad commit 6478dea

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/sysconfig/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,7 @@ def _main():
242242

243243

244244
if __name__ == '__main__':
245-
_main()
245+
try:
246+
_main()
247+
except BrokenPipeError:
248+
pass
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:mod:`sysconfig`'s CLI now ignores :exc:`BrokenPipeError`, making it exit
2+
normally if its output is being piped and the pipe closes.

0 commit comments

Comments
 (0)