Catching WinError 10038

While client.connect() there were OSError: [WinError 10038] an operation was attempted on something that is not a socket
This commit is contained in:
Sergey 2017-09-21 14:35:06 +03:00 committed by Lonami
parent c22224f516
commit 446174c7de

View File

@ -100,7 +100,7 @@ class TcpClient:
except socket.timeout as e:
raise TimeoutError() from e
except OSError as e:
if e.errno == errno.EBADF:
if e.errno == errno.EBADF or e.errno == errno.ENOTSOCK:
self._raise_connection_reset()
else:
raise