diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index b3a5fb0138e..ff76ec445c0 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