dynamically registered handlers (vs. ones registered via set_ev_cls/handler decorators) do not necessarily have h.callers.
Signed-off-by: YAMAMOTO Takashi <[email protected]> --- ryu/base/app_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py index d433c59..695c401 100644 --- a/ryu/base/app_manager.py +++ b/ryu/base/app_manager.py @@ -226,9 +226,10 @@ class RyuApp(object): return handlers def test(h): - if ev_cls not in h.callers: - # this handler does not listen the event. - return False + if not hasattr(h, 'callers') or ev_cls not in h.callers: + # dynamically registered handlers does not have + # h.callers element for the event. + return True states = h.callers[ev_cls].dispatchers if not states: # empty states means all states -- 1.8.3.1 ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
