run_until_disconnected() should disconnect() on finally

This commit is contained in:
Lonami Exo 2019-03-21 12:25:19 +01:00
parent 04ba2e1fc7
commit 347db79979

View File

@ -16,6 +16,8 @@ class UpdateMethods(UserMethods):
try: try:
await self.disconnected await self.disconnected
except KeyboardInterrupt: except KeyboardInterrupt:
pass
finally:
await self.disconnect() await self.disconnect()
def run_until_disconnected(self): def run_until_disconnected(self):
@ -33,6 +35,8 @@ class UpdateMethods(UserMethods):
try: try:
return self.loop.run_until_complete(self.disconnected) return self.loop.run_until_complete(self.disconnected)
except KeyboardInterrupt: except KeyboardInterrupt:
pass
finally:
self.loop.run_until_complete(self.disconnect()) self.loop.run_until_complete(self.disconnect())
def on(self, event): def on(self, event):