1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

bitbake: event/ast: Use better_exec instead of simple_exec

This improves the stacktraces dumped by bitbake when for example anonymous
python functions fail.

Also default to passing code strings to better_exec to match the behaviour of
simple_exec to aid the transition.

(Bitbake rev: 7e8205929ae953731a6854ea80b197847cff5771)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2012-08-21 16:25:07 +00:00
parent 1a7069e97b
commit 21773a997a
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -218,13 +218,15 @@ def better_compile(text, file, realfile, mode = "exec"):
raise
def better_exec(code, context, text, realfile = "<code>"):
def better_exec(code, context, text = None, realfile = "<code>", data = None):
"""
Similiar to better_compile, better_exec will
print the lines that are responsible for the
error.
"""
import bb.parse
if not text:
text = code
if not hasattr(code, "co_filename"):
code = better_compile(code, realfile, realfile)
try: