mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 12:53:44 +03:00
Fix run_until_disconnected's call to disconnect
This commit is contained in:
parent
436fb64289
commit
9eabca6987
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user