]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: utils: Improve traceback from better_exec internal errors
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Dec 2015 17:42:40 +0000 (17:42 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Dec 2015 12:18:19 +0000 (12:18 +0000)
If you break the internals of better_exec(), you get a very weird
error about tb_next not being a method of None. Fix this by checking
we can step back a trace level.

(Bitbake rev: 1d710ed484f68fca0789022dde7ba877b9a894f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index c5ff903ceffbe6ebe79f5983274fb836372ed5db..e564bb6ff460523ee4b5758eb030db7a0393f141 100644 (file)
@@ -327,8 +327,10 @@ def _print_exception(t, value, tb, realfile, text, context):
         exception = traceback.format_exception_only(t, value)
         error.append('Error executing a python function in %s:\n' % realfile)
 
-        # Strip 'us' from the stack (better_exec call)
-        tb = tb.tb_next
+        # Strip 'us' from the stack (better_exec call) unless that was where the 
+        # error came from
+        if tb.tb_next is not None:
+            tb = tb.tb_next
 
         textarray = text.split('\n')