aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-21 03:32:09 -0400
committerRapptz <[email protected]>2017-03-21 03:32:09 -0400
commit5461bfb4752dad1c0b9d9792c4993bac1f0105af (patch)
treea3d6d99e8a31ccb6d0ed4f528deb731269bd9bf4 /discord/client.py
parentEventual consistency fixes. (diff)
downloaddiscord.py-5461bfb4752dad1c0b9d9792c4993bac1f0105af.tar.xz
discord.py-5461bfb4752dad1c0b9d9792c4993bac1f0105af.zip
Check if we're closed before attempting to do a reconnect.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index 8ba5b7b3..e9f5a8ff 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -399,6 +399,9 @@ class Client:
yield from self.close()
raise
+ if self.is_closed():
+ return
+
# We should only get this when an unhandled close code happens,
# such as a clean disconnect (1000) or a bad state (bad token, no sharding, etc)
# sometimes, discord sends us 1000 for unknown reasons so we should reconnect