socket.error is not a subclass of OSError in Python 2
MODIFY
test/socketpair_helper.py
test/socketpair_helper.py
@@ -3,7 +3,10 @@ import socket
try:
_CONNECT_ERROR = (BlockingIOError, InterruptedError)
except:
- _CONNECT_ERROR = (Exception,)
+ try:
+ _CONNECT_ERROR = (WinError, OSError, socket.error)
+ except:
+ _CONNECT_ERROR = (OSError, socket.error)
if hasattr(socket, 'socketpair'):
# Since Python 3.5, socket.socketpair() is now also available on Windows

socket.error is not a subclass of OSError in Python 2