From ac170b0c346184bd8ba2fe1d56ccb9ea003b1a40 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 8 Apr 2010 16:30:52 -0700 Subject: bb.event: NotHandled and Handled are on the way out (Bitbake rev: ed35b30f8e09b0bfc15102fa6483c55d6b7d61de) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/event.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index f49f71cf7..c1c6a36c9 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -23,6 +23,7 @@ BitBake build tools. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import os, re, sys +import warnings import bb.utils import pickle @@ -38,7 +39,7 @@ class Event: self.pid = worker_pid NotHandled = 0 -Handled = 1 +Handled = 1 Registered = 10 AlreadyRegistered = 14 @@ -59,7 +60,10 @@ def fire_class_handlers(event, d): if type(h).__name__ == "code": locals = {"e": event} bb.utils.simple_exec(h, locals) - bb.utils.better_eval("tmpHandler(e)", locals) + ret = bb.utils.better_eval("tmpHandler(e)", locals) + if ret is not None: + warnings.warn("Using Handled/NotHandled in event handlers is deprecated", + DeprecationWarning, stacklevel = 2) else: h(event) del event.data -- cgit v1.2.3