summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r--bitbake/lib/bb/event.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index f49f71cf71..c1c6a36c9d 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -23,6 +23,7 @@ BitBake build tools.
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 24
25import os, re, sys 25import os, re, sys
26import warnings
26import bb.utils 27import bb.utils
27import pickle 28import pickle
28 29
@@ -38,7 +39,7 @@ class Event:
38 self.pid = worker_pid 39 self.pid = worker_pid
39 40
40NotHandled = 0 41NotHandled = 0
41Handled = 1 42Handled = 1
42 43
43Registered = 10 44Registered = 10
44AlreadyRegistered = 14 45AlreadyRegistered = 14
@@ -59,7 +60,10 @@ def fire_class_handlers(event, d):
59 if type(h).__name__ == "code": 60 if type(h).__name__ == "code":
60 locals = {"e": event} 61 locals = {"e": event}
61 bb.utils.simple_exec(h, locals) 62 bb.utils.simple_exec(h, locals)
62 bb.utils.better_eval("tmpHandler(e)", locals) 63 ret = bb.utils.better_eval("tmpHandler(e)", locals)
64 if ret is not None:
65 warnings.warn("Using Handled/NotHandled in event handlers is deprecated",
66 DeprecationWarning, stacklevel = 2)
63 else: 67 else:
64 h(event) 68 h(event)
65 del event.data 69 del event.data