Skip to content

Commit

Permalink
Handle GeneratorExit exception appropriately (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWasTaken committed Jul 8, 2020
1 parent 638c1fa commit c7ab552
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engineio/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,12 @@ async def _service_task(self): # pragma: no cover
if not socket.closing and not socket.closed:
await socket.check_ping_timeout()
await self.sleep(sleep_interval)
except (SystemExit, KeyboardInterrupt, asyncio.CancelledError):
except (
SystemExit,
KeyboardInterrupt,
asyncio.CancelledError,
GeneratorExit,
):
self.logger.info('service task canceled')
break
except:
Expand Down

0 comments on commit c7ab552

Please sign in to comment.