]> git.sur5r.net Git - u-boot/blobdiff - tools/patman/cros_subprocess.py
patman: Convert byte arrays to strings
[u-boot] / tools / patman / cros_subprocess.py
index ebd4300dfd5728d6f5ff52b360d8d8d5be629687..7c760143407b9fe36667312db1ea73f11059073c 100644 (file)
@@ -190,6 +190,8 @@ class Popen(subprocess.Popen):
                 # We will get an error on read if the pty is closed
                 try:
                     data = os.read(self.stdout.fileno(), 1024)
+                    if isinstance(data, bytes):
+                        data = data.decode('utf-8')
                 except OSError:
                     pass
                 if data == "":
@@ -205,6 +207,8 @@ class Popen(subprocess.Popen):
                 # We will get an error on read if the pty is closed
                 try:
                     data = os.read(self.stderr.fileno(), 1024)
+                    if isinstance(data, bytes):
+                        data = data.decode('utf-8')
                 except OSError:
                     pass
                 if data == "":