mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 12:53:44 +03:00
run_until_disconnected() should disconnect() on finally
This commit is contained in:
parent
04ba2e1fc7
commit
347db79979
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user