[gnome-continuous-yocto/gnomeostree-3.28-rocko: 58/8267] bitbake: bb.build: handle __builtins__ as a module



commit 2d2d3121880d65e52cdffe6b6f869aa3f2dd6410
Author: Christopher Larson <chris_larson mentor com>
Date:   Sat Apr 30 12:43:52 2016 -0700

    bitbake: bb.build: handle __builtins__ as a module
    
    Fixes pypy support.
    
    (Bitbake rev: e90cfc655affeec8f5519f7078dad5f99db3c461)
    
    Signed-off-by: Christopher Larson <chris_larson mentor com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/build.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index db5072c..a5b99ed 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/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):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]