summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-15 17:42:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-18 12:18:19 +0000
commit5cb6d83f17b33f4c481e177e8fa3e7123e025d55 (patch)
tree86fd19681a03ca76ab154428fc5b0be11c5af4a1 /bitbake/lib/bb/utils.py
parent0019edc8180e859544da4820fa390b23d975fe08 (diff)
downloadpoky-5cb6d83f17b33f4c481e177e8fa3e7123e025d55.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index c5ff903cef..e564bb6ff4 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -327,8 +327,10 @@ def _print_exception(t, value, tb, realfile, text, context):
327 exception = traceback.format_exception_only(t, value) 327 exception = traceback.format_exception_only(t, value)
328 error.append('Error executing a python function in %s:\n' % realfile) 328 error.append('Error executing a python function in %s:\n' % realfile)
329 329
330 # Strip 'us' from the stack (better_exec call) 330 # Strip 'us' from the stack (better_exec call) unless that was where the
331 tb = tb.tb_next 331 # error came from
332 if tb.tb_next is not None:
333 tb = tb.tb_next
332 334
333 textarray = text.split('\n') 335 textarray = text.split('\n')
334 336