From: Brian Curtin Date: Tue, 2 Nov 2010 03:59:09 +0000 (+0000) Subject: Clean up ResourceWarnings. Explictly close stdout from the subprocess. X-Git-Tag: v3.2a4~183 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b68928bea70b0d9f33e0dc0a9c950291f8c65f15;p=thirdparty%2FPython%2Fcpython.git Clean up ResourceWarnings. Explictly close stdout from the subprocess. --- diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index a453ccc49097..784f95be9ef4 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -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")