From b8154e365ff584438a8d42354e56881e550bb72e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 7 Apr 2020 21:53:55 -0400 Subject: Rewrite gateway to use aiohttp instead of websockets --- discord/client.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'discord/client.py') 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 -- cgit v1.2.3