diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index a453ccc4909..784f95be9ef 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -445,6 +445,7 @@ def joiningfunc(mainthread): p = subprocess.Popen([sys.executable, "-c", script], stdout=subprocess.PIPE) rc = p.wait() data = p.stdout.read().decode().replace('\r', '') + p.stdout.close() self.assertEqual(data, "end of main\nend of thread\n") self.assertFalse(rc == 2, "interpreter was blocked") self.assertTrue(rc == 0, "Unexpected error")