[oe-commits] [bitbake] 01/03: event: remove mapping for deleted event handlers

git at git.openembedded.org git at git.openembedded.org
Fri Jun 23 13:14:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

commit 839f83dea1e99d1d182b138e5aea1df1c45a92fc
Author: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia at linux.intel.com>
AuthorDate: Mon Feb 20 17:54:25 2017 -0600

    event: remove mapping for deleted event handlers
    
    The current remove method for class event handlers does not update the
    event mapping after an event handler is deleted from the main dictionary.
    
    This change enhances the remove method by also updating the event mapping
    accordingly.
    
    This was detected after creating the bb.tests.event module.
    
    [YOCTO #10368]
    
    Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/event.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bb/event.py b/lib/bb/event.py
index eb5cd04..6ccd4bd 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -264,6 +264,11 @@ def register(name, handler, mask=None, filename=None, lineno=None):
 def remove(name, handler):
     """Remove an Event handler"""
     _handlers.pop(name)
+    if name in _catchall_handlers:
+        _catchall_handlers.pop(name)
+    for event in _event_handler_map.keys():
+        if name in _event_handler_map[event]:
+            _event_handler_map[event].pop(name)
 
 def get_handlers():
     return _handlers
@@ -762,4 +767,3 @@ class NetworkTestFailed(Event):
     """
     Event to indicate network test has failed
     """
-

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list