From 95f1ce627e9403bea33a04a5034cca448e6a77b3 Mon Sep 17 00:00:00 2001 From: Jegarde Date: Thu, 25 Apr 2024 14:08:08 +0300 Subject: [PATCH] Merged error check with next elif statement --- discord/gateway.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discord/gateway.py b/discord/gateway.py index 2901eb3230..63da304cc6 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -603,13 +603,11 @@ async def poll_event(self): await self.received_message(msg.data) elif msg.type is aiohttp.WSMsgType.BINARY: await self.received_message(msg.data) - elif msg.type is aiohttp.WSMsgType.ERROR: - _log.debug("Received %s", msg) - raise WebSocketClosure elif msg.type in ( aiohttp.WSMsgType.CLOSED, aiohttp.WSMsgType.CLOSING, aiohttp.WSMsgType.CLOSE, + aiohttp.WSMsgType.ERROR ): _log.debug("Received %s", msg) raise WebSocketClosure