From eefd37c2d78a48429f6fcceb3cfb4dbbc7affe5f Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 3 Feb 2018 12:15:38 +0100 Subject: [PATCH] Stop calling .disconnect() from .__del__() It was causing some strange behaviour with the synchronized Queue used by the UpdateState class. Calling .get() with any timeout would block forever. Perhaps something else got released when the script ended and then any call would block forever, thus the thread never joining. --- telethon/telegram_bare_client.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index fe63ab8a..bff6c1d3 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -255,9 +255,6 @@ class TelegramBareClient: self._first_request = True # On reconnect it will be first again self.session.close() - 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