summaryrefslogtreecommitdiff
path: root/bitbake-dev/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-10-13 08:25:34 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-10-13 08:38:13 +0100
commit44549775ebc01edbca7d934875a43a2d315bdd9b (patch)
treeb7ff54eed32b10f6b5caea78bd5952605a762e03 /bitbake-dev/lib/bb
parent74016daa3a9131129974463452221e4a740bb860 (diff)
downloadopenembedded-core-44549775ebc01edbca7d934875a43a2d315bdd9b.tar.gz
openembedded-core-44549775ebc01edbca7d934875a43a2d315bdd9b.tar.bz2
openembedded-core-44549775ebc01edbca7d934875a43a2d315bdd9b.tar.xz
openembedded-core-44549775ebc01edbca7d934875a43a2d315bdd9b.zip
bitbake: Add bb and os to __builtins__, not the exec function global
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/lib/bb')
-rw-r--r--bitbake-dev/lib/bb/build.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake-dev/lib/bb/build.py b/bitbake-dev/lib/bb/build.py
index 05b7d94d1..b37bcf63b 100644
--- a/bitbake-dev/lib/bb/build.py
+++ b/bitbake-dev/lib/bb/build.py
@@ -28,6 +28,13 @@
from bb import data, event, mkdirhier, utils
import bb, os, sys
+# When we execute a python function we'd like certain things
+# in all namespaces, hence we add them to __builtins__
+# If we do not do this and use the exec globals, they will
+# not be available to subfunctions.
+__builtins__['bb'] = bb
+__builtins__['os'] = os
+
# events
class FuncFailed(Exception):
"""
@@ -205,8 +212,6 @@ def exec_func_python(func, d, runfile, logfile):
f.write(tmp)
comp = utils.better_compile(tmp, func, bbfile)
g = {} # globals
- g['bb'] = bb
- g['os'] = os
g['d'] = d
try:
utils.better_exec(comp, g, tmp, bbfile)