diff options
Diffstat (limited to 'bitbake-dev')
-rw-r--r-- | bitbake-dev/lib/bb/build.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake-dev/lib/bb/build.py b/bitbake-dev/lib/bb/build.py index 05b7d94d13..b37bcf63bc 100644 --- a/bitbake-dev/lib/bb/build.py +++ b/bitbake-dev/lib/bb/build.py | |||
@@ -28,6 +28,13 @@ | |||
28 | from bb import data, event, mkdirhier, utils | 28 | from bb import data, event, mkdirhier, utils |
29 | import bb, os, sys | 29 | import bb, os, sys |
30 | 30 | ||
31 | # When we execute a python function we'd like certain things | ||
32 | # in all namespaces, hence we add them to __builtins__ | ||
33 | # If we do not do this and use the exec globals, they will | ||
34 | # not be available to subfunctions. | ||
35 | __builtins__['bb'] = bb | ||
36 | __builtins__['os'] = os | ||
37 | |||
31 | # events | 38 | # events |
32 | class FuncFailed(Exception): | 39 | class FuncFailed(Exception): |
33 | """ | 40 | """ |
@@ -205,8 +212,6 @@ def exec_func_python(func, d, runfile, logfile): | |||
205 | f.write(tmp) | 212 | f.write(tmp) |
206 | comp = utils.better_compile(tmp, func, bbfile) | 213 | comp = utils.better_compile(tmp, func, bbfile) |
207 | g = {} # globals | 214 | g = {} # globals |
208 | g['bb'] = bb | ||
209 | g['os'] = os | ||
210 | g['d'] = d | 215 | g['d'] = d |
211 | try: | 216 | try: |
212 | utils.better_exec(comp, g, tmp, bbfile) | 217 | utils.better_exec(comp, g, tmp, bbfile) |