Merge "Changed the call to set_tunnel to work in python 2.6 or python 2.7 since its name changed between versions"
This commit is contained in:
commit
02742e602d
@ -194,7 +194,12 @@ def http_connection(url, proxy=None, ssl_compression=True):
|
||||
return request_escaped
|
||||
conn.request = request_wrapper(conn.request)
|
||||
if proxy:
|
||||
conn._set_tunnel(parsed.hostname, parsed.port)
|
||||
try:
|
||||
# python 2.6 method
|
||||
conn._set_tunnel(parsed.hostname, parsed.port)
|
||||
except AttributeError:
|
||||
# python 2.7 method
|
||||
conn.set_tunnel(parsed.hostname, parsed.port)
|
||||
return parsed, conn
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user