mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
bitbake: utils: Improve traceback from better_exec internal errors
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>
This commit is contained in:
@@ -327,8 +327,10 @@ def _print_exception(t, value, tb, realfile, text, context):
|
|||||||
exception = traceback.format_exception_only(t, value)
|
exception = traceback.format_exception_only(t, value)
|
||||||
error.append('Error executing a python function in %s:\n' % realfile)
|
error.append('Error executing a python function in %s:\n' % realfile)
|
||||||
|
|
||||||
# Strip 'us' from the stack (better_exec call)
|
# Strip 'us' from the stack (better_exec call) unless that was where the
|
||||||
tb = tb.tb_next
|
# error came from
|
||||||
|
if tb.tb_next is not None:
|
||||||
|
tb = tb.tb_next
|
||||||
|
|
||||||
textarray = text.split('\n')
|
textarray = text.split('\n')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user