mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix remove_event_handler's loop
This commit is contained in:
parent
e69c186782
commit
5fd6155168
|
@ -2276,8 +2276,10 @@ class TelegramClient(TelegramBareClient):
|
|||
if event and not isinstance(event, type):
|
||||
event = type(event)
|
||||
|
||||
for i, ec in enumerate(self._event_builders):
|
||||
ev, cb = ec
|
||||
i = len(self._event_builders)
|
||||
while i:
|
||||
i -= 1
|
||||
ev, cb = self._event_builders[i]
|
||||
if cb == callback and (not event or isinstance(ev, event)):
|
||||
del self._event_builders[i]
|
||||
found += 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user