[oe-commits] [bitbake] 03/06: process: stop bb.process.communicate mixing bytes and str return types

git at git.openembedded.org git at git.openembedded.org
Fri Feb 24 21:21:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 0cf5589b7fb3582a6caca5014c4d8152347df545
Author: Mike Crowe <mac at mcrowe.com>
AuthorDate: Fri Feb 24 16:20:04 2017 +0000

    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 at mcrowe.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/process.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/process.py b/lib/bb/process.py
index c62d7bc..a4a5599 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:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list