]> granicus.if.org Git - python/commitdiff
Close subprocess pipes in _kill. Fixes a number of ResourceWarnings.
authorBrian Curtin <brian.curtin@gmail.com>
Fri, 5 Nov 2010 15:17:11 +0000 (15:17 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Fri, 5 Nov 2010 15:17:11 +0000 (15:17 +0000)
Lib/test/test_os.py

index b67eed5077fd09b11b0ce79cb3cafec04d1af28b..c7cf24b490eef0b768220a3c73216692fb13be7b 100644 (file)
@@ -1006,6 +1006,9 @@ class Win32KillTests(unittest.TestCase):
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,
                                 stdin=subprocess.PIPE)
+        self.addCleanup(proc.stdout.close)
+        self.addCleanup(proc.stderr.close)
+        self.addCleanup(proc.stdin.close)
 
         count, max = 0, 100
         while count < max and proc.poll() is None: