mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix run_until_disconnected disconnect with telethon.sync
This commit is contained in:
parent
ad01bda503
commit
c0412e4410
|
@ -37,7 +37,12 @@ class UpdateMethods(UserMethods):
|
|||
try:
|
||||
return self.loop.run_until_complete(self.disconnected)
|
||||
except KeyboardInterrupt:
|
||||
# Importing the magic sync module turns disconnect into sync.
|
||||
# TODO Maybe disconnect() should not need the magic module...
|
||||
if inspect.iscoroutinefunction(self.disconnect):
|
||||
self.loop.run_until_complete(self.disconnect())
|
||||
else:
|
||||
self.disconnect()
|
||||
|
||||
def on(self, event):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user