summaryrefslogtreecommitdiff
path: root/swiftclient/client.py
diff options
context:
space:
mode:
authorGreg Lange <greglange@gmail.com>2013-06-07 19:44:42 +0000
committerGreg Lange <greglange@gmail.com>2013-06-07 20:03:00 +0000
commitf045f5bec2b4fa5c3483d27169b351a66b614f91 (patch)
treeb7a0976880aa3c27467242da4a035508381cf43b /swiftclient/client.py
parent2d12f09c66e0221ba7f43cc64677c05486a42ea6 (diff)
downloadpython-swiftclient-f045f5bec2b4fa5c3483d27169b351a66b614f91.tar.gz
Changed the call to set_tunnel to work in python 2.6 or python 2.7 since its name changed between versions
Change-Id: I5550049435002b42c4fea06d41549a1e7254ac02
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r--swiftclient/client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index afd85f0..fb3caf5 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -181,7 +181,12 @@ def http_connection(url, proxy=None):
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