mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-19 11:36:41 +00: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