bitbake: 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. (Bitbake rev: 0cf5589b7fb3582a6caca5014c4d8152347df545) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
3242826304
commit
7b75bf8505
|
@ -162,9 +162,9 @@ def run(cmd, input=None, log=None, extrafiles=None, **options):
|
||||||
stdout, stderr = _logged_communicate(pipe, log, input, extrafiles)
|
stdout, stderr = _logged_communicate(pipe, log, input, extrafiles)
|
||||||
else:
|
else:
|
||||||
stdout, stderr = pipe.communicate(input)
|
stdout, stderr = pipe.communicate(input)
|
||||||
if stdout:
|
if not stdout is None:
|
||||||
stdout = stdout.decode("utf-8")
|
stdout = stdout.decode("utf-8")
|
||||||
if stderr:
|
if not stderr is None:
|
||||||
stderr = stderr.decode("utf-8")
|
stderr = stderr.decode("utf-8")
|
||||||
|
|
||||||
if pipe.returncode != 0:
|
if pipe.returncode != 0:
|
||||||
|
|
Loading…
Reference in New Issue