Skip to content

Commit e316575

Browse files
committed
pumps: FIX don't pump when proc has no streams
1 parent c3c170c commit e316575

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: git/cmd.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@ def pump_stream(cmdline, name, stream, is_decode, handler):
9292
cmdline = getattr(process, 'args', '') # PY3+ only
9393
if not isinstance(cmdline, (tuple, list)):
9494
cmdline = cmdline.split()
95+
96+
pumps = []
97+
if process.stdout:
98+
pumps.append(('stdout', process.stdout, stdout_handler))
99+
if process.stderr:
100+
pumps.append(('stderr', process.stderr, stderr_handler))
101+
95102
threads = []
96-
for name, stream, handler in (
97-
('stdout', process.stdout, stdout_handler),
98-
('stderr', process.stderr, stderr_handler),
99-
):
103+
104+
for name, stream, handler in pumps:
100105
t = threading.Thread(target=pump_stream,
101106
args=(cmdline, name, stream, decode_streams, handler))
102107
t.setDaemon(True)

0 commit comments

Comments
 (0)