From a5836afa4f225d87202260671c8e31b1eb7467d1 Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 28 Apr 2014 15:21:29 -0700 Subject: [PATCH] Fixes issue #161 --- lib/requests/packages/urllib3/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/requests/packages/urllib3/connection.py b/lib/requests/packages/urllib3/connection.py index 21247745..c7d5b77d 100644 --- a/lib/requests/packages/urllib3/connection.py +++ b/lib/requests/packages/urllib3/connection.py @@ -80,7 +80,7 @@ class HTTPConnection(_HTTPConnection, object): def _prepare_conn(self, conn): self.sock = conn - if self._tunnel_host: + if getattr(self, '_tunnel_host', None): # TODO: Fix tunnel so it doesn't depend on self.sock state. self._tunnel()