diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 25c412c1ad..f100446dcc 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -135,7 +135,7 @@ class VariableParse: | |||
135 | self.contains[k] = parser.contains[k].copy() | 135 | self.contains[k] = parser.contains[k].copy() |
136 | else: | 136 | else: |
137 | self.contains[k].update(parser.contains[k]) | 137 | self.contains[k].update(parser.contains[k]) |
138 | value = utils.better_eval(codeobj, DataContext(self.d)) | 138 | value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d}) |
139 | return str(value) | 139 | return str(value) |
140 | 140 | ||
141 | 141 | ||
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 | |||
37 | import signal | 37 | import signal |
38 | import ast | 38 | import ast |
39 | import collections | 39 | import collections |
40 | import copy | ||
40 | from subprocess import getstatusoutput | 41 | from subprocess import getstatusoutput |
41 | from contextlib import contextmanager | 42 | from contextlib import contextmanager |
42 | from ctypes import cdll | 43 | from ctypes import cdll |
@@ -407,8 +408,13 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception | |||
407 | def simple_exec(code, context): | 408 | def simple_exec(code, context): |
408 | exec(code, get_context(), context) | 409 | exec(code, get_context(), context) |
409 | 410 | ||
410 | def better_eval(source, locals): | 411 | def 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 |
414 | def fileslocked(files): | 420 | def fileslocked(files): |