From 43ec577e2c2d630fc38a1e7ebcc13d519f79085c Mon Sep 17 00:00:00 2001 From: Brian Curtin Date: Fri, 5 Nov 2010 15:17:11 +0000 Subject: [PATCH] Close subprocess pipes in _kill. Fixes a number of ResourceWarnings. --- Lib/test/test_os.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index b67eed5077fd..c7cf24b490ee 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1006,6 +1006,9 @@ def _kill(self, sig): 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: