mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +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()
|
return await self.start()
|
||||||
|
|
||||||
def __exit__(self, *args):
|
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):
|
async def __aexit__(self, *args):
|
||||||
await self.disconnect()
|
await self.disconnect()
|
||||||
|
|
|
@ -37,7 +37,8 @@ class UpdateMethods(UserMethods):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
self.loop.run_until_complete(self.disconnect())
|
# No loop.run_until_complete; it's already syncified
|
||||||
|
self.disconnect()
|
||||||
|
|
||||||
def on(self, event):
|
def on(self, event):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user