mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-03 19:00:21 +03:00
Cleanly handle KeyboardInterrupt in run_until_disconnected
This commit is contained in:
parent
1a1d9d346c
commit
3d3698562b
|
@ -27,7 +27,10 @@ class UpdateMethods(UserMethods):
|
|||
will be running already. Use ``await client.disconnected`` in
|
||||
this situation instead.
|
||||
"""
|
||||
try:
|
||||
self.loop.run_until_complete(self.disconnected)
|
||||
except KeyboardInterrupt:
|
||||
self.loop.run_until_complete(self.disconnect())
|
||||
|
||||
def on(self, event):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user