bpo-43826: Fix resource warning due to unclosed objects. (GH-25381)

This commit is contained in:
Karthikeyan Singaravelan 2021-08-24 16:13:46 +05:30 committed by GitHub
parent bb21e28fd0
commit 7179930ab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -719,6 +719,8 @@ def test_pipesizes(self):
# 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 @@ def test_pipesize_default(self):
# 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 @@ def test_send_signal_race2(self):
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',