mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Catch asyncio.CancelledError in 3.8 in typing context manager
In python 3.8, asyncio.CancelledError is a subclass of BaseException rather than Exception, so `except Exception:` will not swallow CancelledError. This change prevents an error in 3.8 from being printed to the console when the following is run: ``` async with ctx.typing(): pass ```
This commit is contained in:
parent
671a19a24a
commit
850a0431bf
@ -30,7 +30,7 @@ def _typing_done_callback(fut):
|
||||
# just retrieve any exception and call it a day
|
||||
try:
|
||||
fut.exception()
|
||||
except Exception:
|
||||
except (asyncio.CancelledError, Exception):
|
||||
pass
|
||||
|
||||
class Typing:
|
||||
|
Loading…
x
Reference in New Issue
Block a user