From 182e9397854810f2f50022e07292dba2b36d511c Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 13 Sep 2017 09:13:31 -0700 Subject: [PATCH] Fix color output handling --- pyqtgraph/multiprocess/processes.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/multiprocess/processes.py b/pyqtgraph/multiprocess/processes.py index c0cd829a..7560ff70 100644 --- a/pyqtgraph/multiprocess/processes.py +++ b/pyqtgraph/multiprocess/processes.py @@ -471,21 +471,20 @@ class FileForwarder(threading.Thread): self.start() def run(self): - if self.output == 'stdout': + if self.output == 'stdout' and self.color is not False: while True: line = self.input.readline() with self.lock: cprint.cout(self.color, line, -1) - elif self.output == 'stderr': + elif self.output == 'stderr' and self.color is not False: while True: line = self.input.readline() with self.lock: cprint.cerr(self.color, line, -1) else: + if isinstance(self.output, str): + self.output = getattr(sys, self.output) while True: line = self.input.readline() with self.lock: self.output.write(line) - - -