This fixes a regression introduced by commit d3f8f4eb.
("RyuApp: delete a key without handlers when unregistering a handler")

Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/base/app_manager.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
index 25b043a..f6d0147 100644
--- a/ryu/base/app_manager.py
+++ b/ryu/base/app_manager.py
@@ -178,8 +178,8 @@ class RyuApp(object):
     def unregister_handler(self, ev_cls, handler):
         assert callable(handler)
         self.event_handlers[ev_cls].remove(handler)
-        if not event_handlers[ev_cls]:
-            del event_handlers[ev_cls]
+        if not self.event_handlers[ev_cls]:
+            del self.event_handlers[ev_cls]
 
     def register_observer(self, ev_cls, name, states=None):
         states = states or set()
-- 
1.8.3.1


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to