diff --git a/socks.py b/socks.py index 83b1435..12b2537 100644 --- a/socks.py +++ b/socks.py @@ -253,7 +253,7 @@ def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, *args, **kwargs): if type not in (socket.SOCK_STREAM, socket.SOCK_DGRAM): msg = "Socket type must be stream or datagram, not {!r}" - raise ValueError(msg.format(type)) + raise socket.error(msg.format(type)) super(socksocket, self).__init__(family, type, proto, *args, **kwargs) self._proxyconn = None # TCP connection to keep UDP relay alive