aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-04-07 21:53:55 -0400
committerRapptz <[email protected]>2020-07-25 09:59:38 -0400
commitb8154e365ff584438a8d42354e56881e550bb72e (patch)
tree799c9bb73c25731a87cb12c04a35b420260f8970 /discord/client.py
parentFix AttributeError on reconnection (diff)
downloaddiscord.py-b8154e365ff584438a8d42354e56881e550bb72e.tar.xz
discord.py-b8154e365ff584438a8d42354e56881e550bb72e.zip
Rewrite gateway to use aiohttp instead of websockets
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/discord/client.py b/discord/client.py
index 0fcdcd48..85931569 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -32,7 +32,6 @@ import sys
import traceback
import aiohttp
-import websockets
from .user import User, Profile
from .asset import Asset
@@ -497,9 +496,7 @@ class Client:
GatewayNotFound,
ConnectionClosed,
aiohttp.ClientError,
- asyncio.TimeoutError,
- websockets.InvalidHandshake,
- websockets.WebSocketProtocolError) as exc:
+ asyncio.TimeoutError) as exc:
self.dispatch('disconnect')
if not reconnect:
@@ -632,7 +629,11 @@ class Client:
_cleanup_loop(loop)
if not future.cancelled():
- return future.result()
+ try:
+ return future.result()
+ except KeyboardInterrupt:
+ # I am unsure why this gets raised here but suppress it anyway
+ return None
# properties