summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/event.py2
-rw-r--r--bitbake/lib/bb/parse/ast.py2
-rw-r--r--bitbake/lib/bb/utils.py4
3 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 20923b5f08..fa179d8a11 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -175,7 +175,7 @@ def register(name, handler):
175 _handlers[name] = noop 175 _handlers[name] = noop
176 return 176 return
177 env = {} 177 env = {}
178 bb.utils.simple_exec(code, env) 178 bb.utils.better_exec(code, env)
179 func = bb.utils.better_eval(name, env) 179 func = bb.utils.better_eval(name, env)
180 _handlers[name] = func 180 _handlers[name] = func
181 else: 181 else:
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 86f94636b9..b88d5f5b39 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -320,7 +320,7 @@ def finalize(fn, d, variant = None):
320 code = [] 320 code = []
321 for funcname in d.getVar("__BBANONFUNCS") or []: 321 for funcname in d.getVar("__BBANONFUNCS") or []:
322 code.append("%s(d)" % funcname) 322 code.append("%s(d)" % funcname)
323 bb.utils.simple_exec("\n".join(code), {"d": d}) 323 bb.utils.better_exec("\n".join(code), {"d": d})
324 bb.data.update_data(d) 324 bb.data.update_data(d)
325 325
326 tasklist = d.getVar('__BBTASKS') or [] 326 tasklist = d.getVar('__BBTASKS') or []
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"):
218 218
219 raise 219 raise
220 220
221def better_exec(code, context, text, realfile = "<code>"): 221def better_exec(code, context, text = None, realfile = "<code>", data = None):
222 """ 222 """
223 Similiar to better_compile, better_exec will 223 Similiar to better_compile, better_exec will
224 print the lines that are responsible for the 224 print the lines that are responsible for the
225 error. 225 error.
226 """ 226 """
227 import bb.parse 227 import bb.parse
228 if not text:
229 text = code
228 if not hasattr(code, "co_filename"): 230 if not hasattr(code, "co_filename"):
229 code = better_compile(code, realfile, realfile) 231 code = better_compile(code, realfile, realfile)
230 try: 232 try: