From 53c660d0dca4296141969233f62de9437567ba0e Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 30 Jun 2018 13:25:59 +0200 Subject: [PATCH] Don't remove reader if fd == -1 --- telethon/extensions/tcpclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/extensions/tcpclient.py b/telethon/extensions/tcpclient.py index a3d68ea7..ace0d38c 100644 --- a/telethon/extensions/tcpclient.py +++ b/telethon/extensions/tcpclient.py @@ -119,7 +119,7 @@ class TcpClient: finally: self._socket = None self._closed.set() - if fd: + if fd and fd != -1: self._loop.remove_reader(fd) async def _wait_timeout_or_close(self, coro):