summaryrefslogtreecommitdiff
path: root/swiftclient
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2019-07-25 11:21:29 -0700
committerTim Burke <tim.burke@gmail.com>2019-07-25 14:21:43 -0700
commit7175069b3e95c38070bb4373019f78c87ab103d0 (patch)
tree740d69eb72f39e68752be713188fdb1e4269a9ed /swiftclient
parent5bd66947fc3d8987d4b24d5119a346031004229e (diff)
downloadpython-swiftclient-7175069b3e95c38070bb4373019f78c87ab103d0.tar.gz
Fix up requests so we can send non-RFC-compliant headers on py3
Change-Id: I3dac826c1f208569c5f40431f59a2045e5744415
Diffstat (limited to 'swiftclient')
-rw-r--r--swiftclient/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index f071182..4be2e2d 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -74,8 +74,10 @@ except ImportError:
pass
# requests version 1.2.3 try to encode headers in ascii, preventing
-# utf-8 encoded header to be 'prepared'
-if StrictVersion(requests.__version__) < StrictVersion('2.0.0'):
+# utf-8 encoded header to be 'prepared'. This also affects all
+# (or at least most) versions of requests on py3
+if StrictVersion(requests.__version__) < StrictVersion('2.0.0') \
+ or not six.PY2:
from requests.structures import CaseInsensitiveDict
def prepare_unicode_headers(self, headers):