mirror of https://github.com/pypa/pip
Always close stderr after subprocess completion in call_subprocess()
When running Python with warnings enabled, fixes warnings of the form: .../site-packages/pip/_internal/vcs/versioncontrol.py:773: ResourceWarning: unclosed file <_io.BufferedReader name=12> return call_subprocess(cmd, cwd,
This commit is contained in:
parent
396afb118e
commit
8662248774
|
@ -0,0 +1 @@
|
|||
Fix ResourceWarning in VCS subprocesses
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue