Clean up ResourceWarnings. Explictly close stdout from the subprocess.

This commit is contained in:
Brian Curtin 2010-11-02 03:59:09 +00:00
parent 21ebbb7d39
commit b68928bea7

View file

@ -445,6 +445,7 @@ class ThreadJoinOnShutdown(BaseTestCase):
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")