diff options
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r-- | bitbake/lib/bb/event.py | 8 |
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 | ||
25 | import os, re, sys | 25 | import os, re, sys |
26 | import warnings | ||
26 | import bb.utils | 27 | import bb.utils |
27 | import pickle | 28 | import pickle |
28 | 29 | ||
@@ -38,7 +39,7 @@ class Event: | |||
38 | self.pid = worker_pid | 39 | self.pid = worker_pid |
39 | 40 | ||
40 | NotHandled = 0 | 41 | NotHandled = 0 |
41 | Handled = 1 | 42 | Handled = 1 |
42 | 43 | ||
43 | Registered = 10 | 44 | Registered = 10 |
44 | AlreadyRegistered = 14 | 45 | AlreadyRegistered = 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 |