diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-13 08:25:34 +0100 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-13 08:38:13 +0100 |
| commit | 44549775ebc01edbca7d934875a43a2d315bdd9b (patch) | |
| tree | b7ff54eed32b10f6b5caea78bd5952605a762e03 /bitbake-dev/lib/bb/build.py | |
| parent | 74016daa3a9131129974463452221e4a740bb860 (diff) | |
| download | poky-44549775ebc01edbca7d934875a43a2d315bdd9b.tar.gz | |
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/build.py')
| -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) |
