]> granicus.if.org Git - python/commitdiff
Fix ResourceWarnings in test_subprocess.
authorNadeem Vawda <nadeem.vawda@gmail.com>
Fri, 19 Aug 2011 03:12:01 +0000 (05:12 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Fri, 19 Aug 2011 03:12:01 +0000 (05:12 +0200)
Lib/test/test_subprocess.py

index b3a5fb0138e9a44e65386b2ee5d4b85031df122b..ff76ec445c04901b6cdaf3c0cd77a575379946ae 100644 (file)
@@ -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