From 7179930ab5f5b2dea039023bec968aadc03e3775 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Tue, 24 Aug 2021 16:13:46 +0530 Subject: bpo-43826: Fix resource warning due to unclosed objects. (GH-25381) --- Lib/test/test_subprocess.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index f0f0e6f..94a95c7 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -719,6 +719,8 @@ class ProcessTestCase(BaseTestCase): # However, this function is not yet in _winapi. p.stdin.write(b"pear") p.stdin.close() + p.stdout.close() + p.stderr.close() finally: p.kill() p.wait() @@ -746,6 +748,8 @@ class ProcessTestCase(BaseTestCase): # On other platforms we cannot test the pipe size (yet). But above # code using pipesize=-1 should not crash. p.stdin.close() + p.stdout.close() + p.stderr.close() finally: p.kill() p.wait() @@ -3243,6 +3247,7 @@ class POSIXProcessTestCase(BaseTestCase): with mock.patch.object(p, 'poll', new=lambda: None): p.returncode = None p.send_signal(signal.SIGTERM) + p.kill() def test_communicate_repeated_call_after_stdout_close(self): proc = subprocess.Popen([sys.executable, '-c', -- cgit v0.12