-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dan Ryan <[email protected]>
- Loading branch information
1 parent
4c86172
commit e375eb3
Showing
2 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
tasks/vendoring/patches/vendor/delegator-close-filehandles.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/pipenv/vendor/delegator.py b/pipenv/vendor/delegator.py | ||
index 0c140cad..3ffb2e31 100644 | ||
--- a/pipenv/vendor/delegator.py | ||
+++ b/pipenv/vendor/delegator.py | ||
@@ -178,6 +178,7 @@ class Command(object): | ||
# Use subprocess. | ||
if self.blocking: | ||
popen_kwargs = self._default_popen_kwargs.copy() | ||
+ del popen_kwargs["stdin"] | ||
popen_kwargs["universal_newlines"] = not binary | ||
if cwd: | ||
popen_kwargs["cwd"] = cwd | ||
@@ -233,18 +234,23 @@ class Command(object): | ||
def block(self): | ||
"""Blocks until process is complete.""" | ||
if self._uses_subprocess: | ||
- self.subprocess.stdin.close() | ||
# consume stdout and stderr | ||
- try: | ||
- stdout, stderr = self.subprocess.communicate() | ||
- self.__out = stdout | ||
- self.__err = stderr | ||
- except ValueError: | ||
- pass # Don't read from finished subprocesses. | ||
+ if self.blocking: | ||
+ try: | ||
+ stdout, stderr = self.subprocess.communicate() | ||
+ self.__out = stdout | ||
+ self.__err = stderr | ||
+ except ValueError: | ||
+ pass # Don't read from finished subprocesses. | ||
+ else: | ||
+ self.subprocess.stdin.close() | ||
+ self.std_out.close() | ||
+ self.std_err.close() | ||
+ self.subprocess.wait() | ||
else: | ||
self.subprocess.sendeof() | ||
- self.subprocess.proc.stdout.close() | ||
self.subprocess.wait() | ||
+ self.subprocess.proc.stdout.close() | ||
|
||
def pipe(self, command, timeout=None, cwd=None): | ||
"""Runs the current command and passes its output to the next |