Fix run_until_disconnected's call to disconnect

This commit is contained in:
Lonami Exo 2019-03-22 18:20:02 +01:00
parent 436fb64289
commit 9eabca6987
2 changed files with 4 additions and 2 deletions

View File

@ -550,7 +550,8 @@ class AuthMethods(MessageParseMethods, UserMethods):
return await self.start()
def __exit__(self, *args):
self.disconnect() # It's also syncified, like start()
# No loop.run_until_complete; it's already syncified
self.disconnect()
async def __aexit__(self, *args):
await self.disconnect()

View File

@ -37,7 +37,8 @@ class UpdateMethods(UserMethods):
except KeyboardInterrupt:
pass
finally:
self.loop.run_until_complete(self.disconnect())
# No loop.run_until_complete; it's already syncified
self.disconnect()
def on(self, event):
"""