aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2017-02-24 16:20:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-24 13:13:01 -0800
commit0cf5589b7fb3582a6caca5014c4d8152347df545 (patch)
tree8f11ceea67103b2381c8a86bfa34b524d37b04be /lib/bb
parentd3bd41d0ec9621307c362b394872b18b8b7ed8d6 (diff)
downloadbitbake-0cf5589b7fb3582a6caca5014c4d8152347df545.tar.gz
process: stop bb.process.communicate mixing bytes and str return types
Python3 regards b"" as False so it is not being converted to a string by d0f904d407f57998419bd9c305ce53e5eaa36b24. This confusingly causes three different potential types for each member of the returned tuple. Let's just assume that everything that's not None is a bytes object and convert it to a string. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r--lib/bb/process.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/process.py b/lib/bb/process.py
index c62d7bca4..a4a559982 100644
--- a/lib/bb/process.py
+++ b/lib/bb/process.py
@@ -162,9 +162,9 @@ def run(cmd, input=None, log=None, extrafiles=None, **options):
stdout, stderr = _logged_communicate(pipe, log, input, extrafiles)
else:
stdout, stderr = pipe.communicate(input)
- if stdout:
+ if not stdout is None:
stdout = stdout.decode("utf-8")
- if stderr:
+ if not stderr is None:
stderr = stderr.decode("utf-8")
if pipe.returncode != 0: