mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-30 05:13: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):
|
if event and not isinstance(event, type):
|
||||||
event = type(event)
|
event = type(event)
|
||||||
|
|
||||||
for i, ec in enumerate(self._event_builders):
|
i = len(self._event_builders)
|
||||||
ev, cb = ec
|
while i:
|
||||||
|
i -= 1
|
||||||
|
ev, cb = self._event_builders[i]
|
||||||
if cb == callback and (not event or isinstance(ev, event)):
|
if cb == callback and (not event or isinstance(ev, event)):
|
||||||
del self._event_builders[i]
|
del self._event_builders[i]
|
||||||
found += 1
|
found += 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user