From 11e23c534af5a0fa9e79ac4c521d7999d3dd3336 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 10 Jun 2021 07:32:05 -0400 Subject: [PATCH] Close ClientSession after closing websocket connections --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 27ec55c1a..4f53c15e2 100644 --- a/discord/client.py +++ b/discord/client.py @@ -527,7 +527,6 @@ class Client: if self._closed: return - await self.http.close() self._closed = True for voice in self.voice_clients: @@ -540,6 +539,7 @@ class Client: if self.ws is not None and self.ws.open: await self.ws.close(code=1000) + await self.http.close() self._ready.clear() def clear(self):