mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Close subprocess pipes to clear ResourceWarning messages in debug mode.
This commit is contained in:
parent
1f1c247adb
commit
c4ac887917
2 changed files with 3 additions and 0 deletions
|
@ -24,6 +24,8 @@ def _assert_python(expected_success, *args):
|
|||
out, err = p.communicate()
|
||||
finally:
|
||||
subprocess._cleanup()
|
||||
p.stdout.close()
|
||||
p.stderr.close()
|
||||
rc = p.returncode
|
||||
if (rc and expected_success) or (not rc and not expected_success):
|
||||
raise AssertionError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue