From 9c4366ffa6b404d5ef8b80331bdb0f295d9256e9 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 20 Feb 2017 12:34:55 +0100 Subject: [PATCH] Don't report direct network errors as proxy errors - last commit reported network errors that happened when proxy was off as network errors --- src/socks/__init__.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/socks/__init__.py b/src/socks/__init__.py index e77c129d..0bfa18f5 100644 --- a/src/socks/__init__.py +++ b/src/socks/__init__.py @@ -445,19 +445,7 @@ class socksocket(socket.socket): raise self.__negotiatehttp(destpair[0], destpair[1]) elif self.__proxy[0] == None: - try: - _orgsocket.connect(self, (destpair[0], destpair[1])) - except socket.error as e: - # ENETUNREACH, WSAENETUNREACH - if e[0] in [101, 10051]: - raise GeneralProxyError((7, _generalerrors[7])) - # ECONNREFUSED, WSAECONNREFUSED - if e[0] in [111, 10061]: - raise GeneralProxyError((8, _generalerrors[8])) - # EHOSTUNREACH, WSAEHOSTUNREACH - if e[0] in [113, 10065]: - raise GeneralProxyError((9, _generalerrors[9])) - raise + _orgsocket.connect(self, (destpair[0], destpair[1])) else: raise GeneralProxyError((4, _generalerrors[4]))