diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-02-07 12:20:04 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2016-02-07 12:20:04 +0100 |
commit | f8775f9b8e40b18352399445dba99dd1d805e8c6 (patch) | |
tree | 49e0c4abff2ceb73aab5d420e682e012b25c798a /git/cmd.py | |
parent | 9b10d5e75570ac6325d1c7e2b32882112330359a (diff) | |
download | gitpython-f8775f9b8e40b18352399445dba99dd1d805e8c6.tar.gz |
fix(cmd): prevent deadlock on clone/fetch/pull
We keep stdout closed, which seems to have the side-effect of
stdout being connected to your TTY, in case you run a terminal.
However, this shold also prevent deadlocks, as only stderr is used.
The alternative would have been to try to fetch lines concurrently,
and we have been there.
For clone(), `communicate()` is used, and with some luck this will
just do the right thing. Even though last time I checked, it
didn't ... ? Lets see.
Stab at #72
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -279,8 +279,10 @@ class Git(LazyMixin): self.proc = None if proc.stdin: proc.stdin.close() - proc.stdout.close() - proc.stderr.close() + if proc.stdout: + proc.stdout.close() + if proc.stderr: + proc.stderr.close() # did the process finish already so we have a return code ? if proc.poll() is not None: |