Skip to content

Commit 1b10efa

Browse files
authored
gh-117649: Fix file descriptor leak in (expected) failing test case (#117780)
The test case is currently expected to fail in the free-threaded build. However, it fails before it gets a chance to close the write end of the pipe.
1 parent 25f6ff5 commit 1b10efa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_capi/test_misc.py

+3
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,9 @@ def check(enabled, override):
21392139
}
21402140

21412141
r, w = os.pipe()
2142+
if Py_GIL_DISABLED:
2143+
# gh-117649: The test fails before `w` is closed
2144+
self.addCleanup(os.close, w)
21422145
script = textwrap.dedent(f'''
21432146
from test.test_capi.check_config import run_singlephase_check
21442147
run_singlephase_check({override}, {w})

0 commit comments

Comments
 (0)