From a3be7cb87f277c801c6b375d3e1edbc382a86f6a Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Mon, 2 Jul 2018 14:55:08 +0100 Subject: [PATCH] ENH: Process stdout wrapper forwards lines in real time. --- fsl/utils/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsl/utils/run.py b/fsl/utils/run.py index a8adb80b8..4c45f6aa8 100644 --- a/fsl/utils/run.py +++ b/fsl/utils/run.py @@ -107,7 +107,7 @@ def _forwardStream(in_, *outs): omodes = [getattr(o, 'mode', 'w') for o in outs] def realForward(): - for line in in_: + for line in iter(in_.readline, b''): for i, o in enumerate(outs): if 'b' in omodes[i]: o.write(line) else: o.write(line.decode('utf-8')) -- GitLab