Merge pull request #9156 from jdufresne/resource-warning

Always close stderr after subprocess completion in call_subprocess()
This commit is contained in:
Pradyun Gedam 2020-11-21 16:18:14 +00:00 committed by GitHub
commit a19f1303fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

1
news/9156.bugfix.rst Normal file
View File

@ -0,0 +1 @@
Fix ResourceWarning in VCS subprocesses

View File

@ -150,6 +150,8 @@ def call_subprocess(
finally:
if proc.stdout:
proc.stdout.close()
if proc.stderr:
proc.stderr.close()
proc_had_error = (
proc.returncode and proc.returncode not in extra_ok_returncodes