mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-136003: Close file descriptors in test (GH-139225)
This fixes file descriptor leaks introduced in GH-136004
This commit is contained in:
parent
a756a4b953
commit
61e54e52ea
1 changed files with 2 additions and 0 deletions
|
|
@ -1996,6 +1996,7 @@ def test_pending_call_creates_thread_subinterpreter(self):
|
||||||
def output():
|
def output():
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
os.write({w}, b"x")
|
os.write({w}, b"x")
|
||||||
|
os.close({w})
|
||||||
|
|
||||||
|
|
||||||
def callback():
|
def callback():
|
||||||
|
|
@ -2014,6 +2015,7 @@ def create_pending_call():
|
||||||
interp.close()
|
interp.close()
|
||||||
data = os.read(r, 1)
|
data = os.read(r, 1)
|
||||||
self.assertEqual(data, b"x")
|
self.assertEqual(data, b"x")
|
||||||
|
os.close(r)
|
||||||
|
|
||||||
|
|
||||||
@requires_subinterpreters
|
@requires_subinterpreters
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue