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.
This commit is contained in:
Lonami Exo 2017-09-23 11:31:58 +02:00
parent 80e9877256
commit b04607e7ba

View File

@ -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()