From 48e96ca15fdd2a2d38d0aadc39cb6e9f6e711016 Mon Sep 17 00:00:00 2001 From: Lonami Date: Tue, 14 Nov 2017 12:01:33 +0100 Subject: [PATCH] Fix ._get_connected failing when .fileno() == 0 ( #427) --- telethon/extensions/tcp_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/extensions/tcp_client.py b/telethon/extensions/tcp_client.py index 3f803e63..164429f3 100644 --- a/telethon/extensions/tcp_client.py +++ b/telethon/extensions/tcp_client.py @@ -59,7 +59,7 @@ class TcpClient: raise def _get_connected(self): - return self._socket is not None and self._socket.fileno() > 0 + return self._socket is not None and self._socket.fileno() >= 0 connected = property(fget=_get_connected)