Commit 9eb11443 authored by Martin Craig's avatar Martin Craig
Browse files

Send command output to streams in real time

parent 2b4bf58e
...@@ -107,7 +107,7 @@ def _forwardStream(in_, *outs): ...@@ -107,7 +107,7 @@ def _forwardStream(in_, *outs):
omodes = [getattr(o, 'mode', 'w') for o in outs] omodes = [getattr(o, 'mode', 'w') for o in outs]
def realForward(): def realForward():
for line in in_: for line in iter(in_.readline, b''):
for i, o in enumerate(outs): for i, o in enumerate(outs):
if 'b' in omodes[i]: o.write(line) if 'b' in omodes[i]: o.write(line)
else: o.write(line.decode('utf-8')) else: o.write(line.decode('utf-8'))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment