From 2d2d3121880d65e52cdffe6b6f869aa3f2dd6410 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Sat, 30 Apr 2016 12:43:52 -0700 Subject: bitbake: bb.build: handle __builtins__ as a module Fixes pypy support. (Bitbake rev: e90cfc655affeec8f5519f7078dad5f99db3c461) Signed-off-by: Christopher Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index db5072cb4d..a5b99edb7b 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): -- cgit v1.2.3-54-g00ecf