Skip to content
Permalink
Browse files

Fix AttributeError on reconnect with no retries

Closes #1646.
  • Loading branch information
Lonami committed Dec 11, 2020
1 parent becfe2c commit ee0fc5cc29ad6c7cabbd36edeb5e0355dd98b019
Showing with 3 additions and 1 deletion.
  1. +3 −1 telethon/network/mtprotosender.py
@@ -404,7 +404,9 @@ async def _reconnect(self, last_error):

if not ok:
self._log.error('Automatic reconnection failed %d time(s)', attempt)
await self._disconnect(error=last_error.with_traceback(None))
# There may be no error (e.g. automatic reconnection was turned off).
error = last_error.with_traceback(None) if last_error else None
await self._disconnect(error=error)

def _start_reconnect(self, error):
"""Starts a reconnection in the background."""

0 comments on commit ee0fc5c

Please sign in to comment.