From: Nadeem Vawda Date: Fri, 19 Aug 2011 03:12:01 +0000 (+0200) Subject: Fix ResourceWarnings in test_subprocess. X-Git-Tag: v3.2.3rc1~644 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d7cda3e6327251215560bc2e21404abe392289c;p=thirdparty%2FPython%2Fcpython.git Fix ResourceWarnings in test_subprocess. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index b3a5fb0138e9..ff76ec445c04 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1404,6 +1404,8 @@ class POSIXProcessTestCase(BaseTestCase): 'time.sleep(0.2)'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.addCleanup(p.stdout.close) + self.addCleanup(p.stderr.close) ident = id(p) pid = p.pid del p @@ -1421,6 +1423,8 @@ class POSIXProcessTestCase(BaseTestCase): 'time.sleep(3)'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.addCleanup(p.stdout.close) + self.addCleanup(p.stderr.close) ident = id(p) pid = p.pid del p