summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 8f75871c18..0a1bf6880a 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -37,6 +37,7 @@ import errno
37import signal 37import signal
38import ast 38import ast
39import collections 39import collections
40import copy
40from subprocess import getstatusoutput 41from subprocess import getstatusoutput
41from contextlib import contextmanager 42from contextlib import contextmanager
42from ctypes import cdll 43from ctypes import cdll
@@ -407,8 +408,13 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception
407def simple_exec(code, context): 408def simple_exec(code, context):
408 exec(code, get_context(), context) 409 exec(code, get_context(), context)
409 410
410def better_eval(source, locals): 411def better_eval(source, locals, extraglobals = None):
411 return eval(source, get_context(), locals) 412 ctx = get_context()
413 if extraglobals:
414 ctx = copy.copy(ctx)
415 for g in extraglobals:
416 ctx[g] = extraglobals[g]
417 return eval(source, ctx, locals)
412 418
413@contextmanager 419@contextmanager
414def fileslocked(files): 420def fileslocked(files):