X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/488325e39baa1ee7fc2ece028f95ccbd74d43609..b8d8e13c1f9e4d3cdd7d41c5c9d711a36dd5f9c3:/youtube_dl/socks.py

diff --git a/youtube_dl/socks.py b/youtube_dl/socks.py
index 63d19b3..0f5d7bd 100644
--- a/youtube_dl/socks.py
+++ b/youtube_dl/socks.py
@@ -55,12 +55,12 @@ class Socks5AddressType(object):
     ATYP_IPV6 = 0x04
 
 
-class ProxyError(IOError):
+class ProxyError(socket.error):
     ERR_SUCCESS = 0x00
 
     def __init__(self, code=None, msg=None):
         if code is not None and msg is None:
-            msg = self.CODES.get(code) and 'unknown error'
+            msg = self.CODES.get(code) or 'unknown error'
         super(ProxyError, self).__init__(code, msg)
 
 
@@ -123,7 +123,7 @@ class sockssocket(socket.socket):
         while len(data) < cnt:
             cur = self.recv(cnt - len(data))
             if not cur:
-                raise IOError('{0} bytes missing'.format(cnt - len(data)))
+                raise EOFError('{0} bytes missing'.format(cnt - len(data)))
             data += cur
         return data