Skip to content

Commit

Permalink
Merge pull request #9156 from jdufresne/resource-warning
Browse files Browse the repository at this point in the history
Always close stderr after subprocess completion in call_subprocess()
  • Loading branch information
pradyunsg committed Nov 21, 2020
2 parents 396afb1 + 8662248 commit a19f130
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/9156.bugfix.rst
@@ -0,0 +1 @@
Fix ResourceWarning in VCS subprocesses
2 changes: 2 additions & 0 deletions src/pip/_internal/vcs/versioncontrol.py
Expand Up @@ -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
Expand Down

0 comments on commit a19f130

Please sign in to comment.