From 21773a997a2a8ece3b9549c5940468c5a889ac40 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 21 Aug 2012 16:25:07 +0000 Subject: 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 --- bitbake/lib/bb/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/utils.py') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index ee4ef73bfc..44a42a0136 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -218,13 +218,15 @@ def better_compile(text, file, realfile, mode = "exec"): raise -def better_exec(code, context, text, realfile = ""): +def better_exec(code, context, text = None, realfile = "", 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: -- cgit v1.2.3-54-g00ecf