mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-24 16:24:15 +03:00
Fix BrokenPipeError was instance of OSError
This commit is contained in:
parent
4a8e5c865a
commit
9dfb5d493c
|
@ -90,13 +90,13 @@ class TcpClient:
|
||||||
self._socket.sendall(data)
|
self._socket.sendall(data)
|
||||||
except socket.timeout as e:
|
except socket.timeout as e:
|
||||||
raise TimeoutError() from e
|
raise TimeoutError() from e
|
||||||
|
except BrokenPipeError:
|
||||||
|
self._raise_connection_reset()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.EBADF:
|
if e.errno == errno.EBADF:
|
||||||
self._raise_connection_reset()
|
self._raise_connection_reset()
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
except BrokenPipeError:
|
|
||||||
self._raise_connection_reset()
|
|
||||||
|
|
||||||
def read(self, size):
|
def read(self, size):
|
||||||
"""Reads (receives) a whole block of 'size bytes
|
"""Reads (receives) a whole block of 'size bytes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user