-
Notifications
You must be signed in to change notification settings - Fork 780
Exception occurring while calling "stop()" from sink prevent handler to be removed #237
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Currently, if an exception occurs in stop(), the handle can't be removed:
Lines 979 to 997 in 00ee30f
| with self._core.lock: | |
| handlers = self._core.handlers.copy() | |
| if handler_id is None: | |
| for handler in handlers.values(): | |
| handler.stop() | |
| handlers.clear() | |
| else: | |
| try: | |
| handler = handlers.pop(handler_id) | |
| except KeyError: | |
| raise ValueError( | |
| "There is no existing handler with id %d" % handler_id | |
| ) from None | |
| handler.stop() | |
| levelnos = (h.levelno for h in handlers.values()) | |
| self._core.min_level = min(levelnos, default=float("inf")) | |
| self._core.handlers = handlers |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working