From 4160cd7d12f54337d66f5d2994c3b7c537fbf054 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 24 Mar 2017 20:40:23 -0400 Subject: [PATCH] Set closed state before actually finishing cleaning up. --- discord/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 12fbe6e63..f00824ec6 100644 --- a/discord/client.py +++ b/discord/client.py @@ -425,6 +425,8 @@ class Client: if self.is_closed(): return + self._closed.set() + for voice in list(self.voice_clients): try: yield from voice.disconnect() @@ -439,7 +441,6 @@ class Client: yield from self.http.close() - self._closed.set() self._ready.clear() @asyncio.coroutine