mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-11 00:22:29 +03:00
Fix remove_event_handler
This commit is contained in:
parent
fa6e5d95a9
commit
2c64970451
|
@ -148,10 +148,11 @@ def remove_event_handler(
|
||||||
|
|
||||||
# slow-path, remove all matching
|
# slow-path, remove all matching
|
||||||
removed = []
|
removed = []
|
||||||
for index, handler in reversed(enumerate(self._update_handlers)):
|
for index in reversed(range(len(self._update_handlers))):
|
||||||
if callback is not None and handler.callback != callback:
|
handler = self._update_handlers[index]
|
||||||
|
if callback is not None and handler._callback != callback:
|
||||||
continue
|
continue
|
||||||
if event is not None and handler.event != event:
|
if event is not None and handler._event != event:
|
||||||
continue
|
continue
|
||||||
removed.append(self._update_handlers.pop(index))
|
removed.append(self._update_handlers.pop(index))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user