Skip to contentSkip to conversation

utils: Avoid traceback errors

PATCH New Richard Purdie 1 participant 1 message Dec 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils: Avoid traceback errors

Avoid errors like:

ERROR: Exception handler error: 'NoneType' object has no attribute 'decode'

---
 bitbake/lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/utils.py +1 -1
index c4b25b5..9073f15 100644
@@ -378,7 +378,7 @@ def _print_exception(t, value, tb, realfile, text, context):
 
         # If the exception is from spwaning a task, let's be helpful and display
         # the output (which hopefully includes stderr).
-        if isinstance(value, subprocess.CalledProcessError):
+        if isinstance(value, subprocess.CalledProcessError) and value.output:
             error.append("Subprocess output:")
             error.append(value.output.decode("utf-8", errors="ignore"))
     finally:
Signature · 1 line
2.7.4