All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] utils: Improve traceback from better_exec internal errors
@ 2015-12-15 17:42 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-12-15 17:42 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 31ec2b7..4ed7608 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -323,8 +323,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')




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-15 17:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-15 17:42 [PATCH] utils: Improve traceback from better_exec internal errors Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.