[gnome-continuous-yocto/gnomeostree-3.28-rocko: 59/8267] bitbake: bb.event: handle __builtins__ as a module
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 59/8267] bitbake: bb.event: handle __builtins__ as a module
- Date: Sat, 16 Dec 2017 19:53:46 +0000 (UTC)
commit cd20dd057b74fac39a0b635e479ccfdcb62452fc
Author: Christopher Larson <chris_larson mentor com>
Date: Sat Apr 30 12:43:53 2016 -0700
bitbake: bb.event: handle __builtins__ as a module
Fixes pypy support.
(Bitbake rev: a3e5d9337f5400aab13df63f261e750178f8a661)
Signed-off-by: Christopher Larson <chris_larson mentor com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/lib/bb/event.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 5ffe89e..5a03a31 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -72,11 +72,16 @@ _catchall_handlers = {}
_eventfilter = None
_uiready = False
+if hasattr(__builtins__, '__setitem__'):
+ builtins = __builtins__
+else:
+ builtins = __builtins__.__dict__
+
def execute_handler(name, handler, event, d):
event.data = d
addedd = False
- if 'd' not in __builtins__:
- __builtins__['d'] = d
+ if 'd' not in builtins:
+ builtins['d'] = d
addedd = True
try:
ret = handler(event)
@@ -94,7 +99,7 @@ def execute_handler(name, handler, event, d):
finally:
del event.data
if addedd:
- del __builtins__['d']
+ del builtins['d']
def fire_class_handlers(event, d):
if isinstance(event, logging.LogRecord):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]