Skip to content

Commit

Permalink
App Engine does not have _tunnel_host set in its httplib implementati…
Browse files Browse the repository at this point in the history
…on. Make sure we check for that. urllib3#1503. Not this reverts part of the change in urllib3#1430.
  • Loading branch information
speedplane committed Dec 19, 2018
1 parent abdc0b9 commit 3c813db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/urllib3/connection.py
Expand Up @@ -171,7 +171,7 @@ def _new_conn(self):

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()
# Mark this connection as not reusable
Expand Down Expand Up @@ -301,7 +301,8 @@ def connect(self):
conn = self._new_conn()
hostname = self.host

if self._tunnel_host:
# Google App Engine's different HTTP lib may not define_tunnel_host.
if getattr(self, '_tunnel_host', None):
self.sock = conn
# Calls self._set_hostport(), so self.host is
# self._tunnel_host below.
Expand Down

0 comments on commit 3c813db

Please sign in to comment.