mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Call .disconnect() on client.__del__ for convenience
This commit is contained in:
parent
b45b63d71d
commit
6cb5931e7a
|
@ -270,6 +270,9 @@ class TelegramBareClient:
|
|||
# TODO Shall we clear the _exported_sessions, or may be reused?
|
||||
self._first_request = True # On reconnect it will be first again
|
||||
|
||||
def __del__(self):
|
||||
self.disconnect()
|
||||
|
||||
def _reconnect(self, new_dc=None):
|
||||
"""If 'new_dc' is not set, only a call to .connect() will be made
|
||||
since it's assumed that the connection has been lost and the
|
||||
|
|
Loading…
Reference in New Issue
Block a user