Skip to content

Commit b160f4d

Browse files
authored
Merge pull request #7 from celeraone/fixes
Fixes
2 parents 7014d2b + 0e696d6 commit b160f4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/HttpLibrary/livetest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
3636
"""
3737

38+
from __future__ import unicode_literals
3839
from future import standard_library
3940
standard_library.install_aliases()
4041
from builtins import object
@@ -130,7 +131,12 @@ def __init__(self, host, scheme='http', relative_to=None):
130131

131132
def _do_httplib_request(self, req):
132133
"Convert WebOb Request to httplib request."
133-
headers = dict((name, val) for name, val in req.headers.items())
134+
headers = {}
135+
136+
for name, val in req.headers.items():
137+
if sys.version_info[0] == 2 and isinstance(name, unicode):
138+
name = str(name)
139+
headers[name] = val
134140
if req.scheme not in self.conn:
135141
self._load_conn(req.scheme)
136142

0 commit comments

Comments
 (0)