gh-136003: Close file descriptors in test (GH-139225)

This fixes file descriptor leaks introduced in GH-136004
This commit is contained in:
Petr Viktorin 2025-09-22 13:22:27 +02:00 committed by GitHub
parent a756a4b953
commit 61e54e52ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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