[bitbake-devel] [master][PATCH 1/3] bb.build: handle __builtins__ as a module
Christopher Larson
kergoth at gmail.com
Sat Apr 30 19:43:52 UTC 2016
From: Christopher Larson <chris_larson at mentor.com>
Fixes pypy support.
Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
lib/bb/build.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/bb/build.py b/lib/bb/build.py
index db5072c..a5b99ed 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -61,8 +61,13 @@ def reset_cache():
# 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
+if hasattr(__builtins__, '__setitem__'):
+ builtins = __builtins__
+else:
+ builtins = __builtins__.__dict__
+
+builtins['bb'] = bb
+builtins['os'] = os
class FuncFailed(Exception):
def __init__(self, name = None, logfile = None):
--
2.8.0
More information about the bitbake-devel
mailing list