Skip to content

Commit 28d11f4

Browse files
committed
fix(dispatcher): handle asyncio.CancelledError in handler tasks
1 parent a9e42e8 commit 28d11f4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pyrogram/dispatcher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ async def stop(self, clear_handlers: bool = True):
328328
self.updates_queue.put_nowait(None)
329329

330330
for i in self.handler_worker_tasks:
331-
await i
331+
try:
332+
await i
333+
except asyncio.CancelledError:
334+
pass
332335

333336
self.handler_worker_tasks.clear()
334337
self.locks_list.clear()

0 commit comments

Comments
 (0)