]> granicus.if.org Git - python/commitdiff
Clean up ResourceWarnings. Explictly close stdout from the subprocess.
authorBrian Curtin <brian.curtin@gmail.com>
Tue, 2 Nov 2010 03:59:09 +0000 (03:59 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Tue, 2 Nov 2010 03:59:09 +0000 (03:59 +0000)
Lib/test/test_threading.py

index a453ccc490973e5ad4893997f8ece6513a9abee5..784f95be9ef4290e49ec07b1d4f380045055c6e2 100644 (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")