diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 90bf6425cbf..0d93b43e84b 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -590,6 +590,7 @@ def test_issue7964(self): stdin=subprocess.PIPE, stderr=subprocess.STDOUT, ) + self.addCleanup(proc.stdout.close) stdout, stderr = proc.communicate(b'quit\n') self.assertNotIn(b'SyntaxError', stdout, "Got a syntax error running test script under PDB")