aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index afd5bf57..8559858f 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -48,13 +48,18 @@ _handlers = {}
_ui_handlers = {}
_ui_handler_seq = 0
+# For compatibility
+bb.utils._context["NotHandled"] = NotHandled
+bb.utils._context["Handled"] = Handled
+
def fire_class_handlers(event, d):
for handler in _handlers:
h = _handlers[handler]
event.data = d
if type(h).__name__ == "code":
- exec(h)
- tmpHandler(event)
+ locals = {"e": event}
+ exec h in bb.utils._context, locals
+ bb.utils.better_eval("tmpHandler(e)", locals)
else:
h(event)
del event.data