Pass an empty locals dict in expansion, since list comprehensions apparently leak their '_' helper variable

(Bitbake rev: 97da0cebbaf4dd1b46e58bd2e80cab6c007ae7c9)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Chris Larson 2010-03-30 16:59:46 -07:00 committed by Richard Purdie
parent d8c8612d92
commit eb16773704
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class DataSmart:
self._seen_overrides = seen
self.expand_cache = {}
self.expand_context = {
self.expand_globals = {
"os": os,
"bb": bb,
"time": time,
@ -72,7 +72,7 @@ class DataSmart:
def python_sub(match):
code = match.group()[3:-1]
codeobj = compile(code.strip(), varname or "<expansion>", "eval")
s = eval(codeobj, self.expand_context)
s = eval(codeobj, self.expand_globals, {})
if type(s) == types.IntType: s = str(s)
return s