From b04607e7ba933291537516188803618571e6d4ef Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 23 Sep 2017 11:31:58 +0200 Subject: [PATCH] Ignore requests invoked from ReadThread instead raising Any unhandled exception on the ReadThread would cause it to stop, and handling the exception to the main thread on the next invoke or poll. Instead causing the thread to stop, simply ignore it. --- telethon/telegram_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 18f305ac..40ff5401 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -246,7 +246,7 @@ class TelegramClient(TelegramBareClient): # This is only valid when the read thread is reconnecting, # that is, the connection lock is locked. if self._on_read_thread() and not self._connect_lock.locked(): - raise AssertionError('Cannot invoke requests from the ReadThread') + return # Just ignore, we would be raising and crashing the thread self.updates.check_error()