Skip to content

Commit a813bde

Browse files
Handle CancelledError in async pubsub managers (Fixes #750)
1 parent fb3ac95 commit a813bde

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/socketio/asyncio_pubsub_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
from functools import partial
23
import uuid
34

@@ -148,6 +149,8 @@ async def _thread(self):
148149
while True:
149150
try:
150151
message = await self._listen()
152+
except asyncio.CancelledError: # pragma: no cover
153+
break
151154
except:
152155
import traceback
153156
traceback.print_exc()

0 commit comments

Comments
 (0)