From 9560bcc3240b7f94006f9476d79e49f2dad71f05 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 30 Sep 2017 10:24:54 +0200 Subject: [PATCH] Remove "if background thread" check as it isn't exposed anymore --- telethon/telegram_bare_client.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index 38fd1555..e9eae399 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -373,12 +373,6 @@ class TelegramBareClient: The invoke will be retried up to 'retries' times before raising ValueError(). """ - # This is only valid when the read thread is reconnecting, - # that is, the connection lock is locked. - on_read_thread = self._on_read_thread() - if on_read_thread and not self._connect_lock.locked(): - return # Just ignore, we would be raising and crashing the thread - # Any error from a background thread will be "posted" and checked here self.updates.check_error() @@ -392,7 +386,7 @@ class TelegramBareClient: # Determine the sender to be used (main or a new connection) # TODO Polish this so it's nicer on_main_thread = threading.get_ident() == self._main_thread_ident - if on_main_thread or on_read_thread: + if on_main_thread or self._on_read_thread(): sender = self._sender else: conn = Connection(