aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-05-10 20:21:08 -0400
committerRapptz <[email protected]>2016-05-10 20:21:08 -0400
commitb8eab5f656df873598a10999c429570df91c2bdb (patch)
tree5a2604914e1d937297ff2646dfea783c862e915f
parentForce encoding of text retrieval functions to use utf-8. (diff)
downloaddiscord.py-b8eab5f656df873598a10999c429570df91c2bdb.tar.xz
discord.py-b8eab5f656df873598a10999c429570df91c2bdb.zip
Change second run_until_complete to not be empty.
This should stop the infinite loops in some cases.
-rw-r--r--discord/client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py
index 94d7b5b1..ebf9bfe6 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -470,7 +470,10 @@ class Client:
gathered = asyncio.gather(*pending)
try:
gathered.cancel()
- self.loop.run_forever()
+ self.loop.run_until_complete(gathered)
+
+ # we want to retrieve any exceptions to make sure that
+ # they don't nag us about it being un-retrieved.
gathered.exception()
except:
pass