Skip to content

Commit af9fed2

Browse files
committed
Re-instated proxy test otherwise this breaks the code if no proxy is set.
1 parent 6a787b0 commit af9fed2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ndg/httpsclient/https.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ def connect(self):
7878

7979
sock = socket.create_connection((self.host, self.port), self.timeout)
8080

81-
# Tunnel if using a proxy
82-
self.sock = sock
83-
self._tunnel()
81+
# Tunnel if using a proxy - ONLY available for Python 2.6.2 and above
82+
if getattr(self, '_tunnel_host', None):
83+
self.sock = sock
84+
self._tunnel()
8485

8586
self.sock = SSLSocket(ssl_context, sock)
8687

0 commit comments

Comments
 (0)