diff options
author | Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> | 2017-02-20 17:54:25 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-23 14:12:27 +0100 |
commit | 839f83dea1e99d1d182b138e5aea1df1c45a92fc (patch) | |
tree | 3b6927cdf7cbe2d5f16c7228e7ac6296c89fcd7f /lib/bb/event.py | |
parent | 022adb30dbb0df764c9fb515918cb9a88e4f8d6f (diff) | |
download | bitbake-contrib-839f83dea1e99d1d182b138e5aea1df1c45a92fc.tar.gz |
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@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r-- | lib/bb/event.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py index eb5cd0459..6ccd4bdc3 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 """ - |