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:14:17 +0100 |
commit | d591b00af06abd197904902baed3a6d2fcb5dbc6 (patch) | |
tree | 6d25023e9a8bfe6e4d26b79e6e9fad7cd9aaeeae /bitbake/lib | |
parent | 00e2566f0ee0bd1ca29d0fe6239b61471865bfd9 (diff) | |
download | poky-d591b00af06abd197904902baed3a6d2fcb5dbc6.tar.gz |
bitbake: 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]
(Bitbake rev: 839f83dea1e99d1d182b138e5aea1df1c45a92fc)
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 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/event.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index eb5cd04597..6ccd4bdc38 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -264,6 +264,11 @@ def register(name, handler, mask=None, filename=None, lineno=None): | |||
264 | def remove(name, handler): | 264 | def remove(name, handler): |
265 | """Remove an Event handler""" | 265 | """Remove an Event handler""" |
266 | _handlers.pop(name) | 266 | _handlers.pop(name) |
267 | if name in _catchall_handlers: | ||
268 | _catchall_handlers.pop(name) | ||
269 | for event in _event_handler_map.keys(): | ||
270 | if name in _event_handler_map[event]: | ||
271 | _event_handler_map[event].pop(name) | ||
267 | 272 | ||
268 | def get_handlers(): | 273 | def get_handlers(): |
269 | return _handlers | 274 | return _handlers |
@@ -762,4 +767,3 @@ class NetworkTestFailed(Event): | |||
762 | """ | 767 | """ |
763 | Event to indicate network test has failed | 768 | Event to indicate network test has failed |
764 | """ | 769 | """ |
765 | |||