
In python 3.x reading stdout or stdin will produce a bytestring rather than a string. Decode it in CommunicateFilter such that the rest of the code can continue to deal with strings. This works fine with python 2.x too.
Signed-off-by: Paul Burton paul.burton@imgtec.com Acked-by: Simon Glass sjg@chromium.org ---
Changes in v2: None
tools/patman/cros_subprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py index ebd4300..922e560 100644 --- a/tools/patman/cros_subprocess.py +++ b/tools/patman/cros_subprocess.py @@ -189,7 +189,7 @@ class Popen(subprocess.Popen): data = "" # We will get an error on read if the pty is closed try: - data = os.read(self.stdout.fileno(), 1024) + data = os.read(self.stdout.fileno(), 1024).decode('utf8') except OSError: pass if data == "": @@ -204,7 +204,7 @@ class Popen(subprocess.Popen): data = "" # We will get an error on read if the pty is closed try: - data = os.read(self.stderr.fileno(), 1024) + data = os.read(self.stderr.fileno(), 1024).decode('utf8') except OSError: pass if data == "":