Import httplib from six.moves

Import httplib from six.moves
Use six.StringIO to replace StringIO

Partial implement: blueprint py33-support

Change-Id: Ic20ce1139d1b296c7cbb666a200b2d9260764636
This commit is contained in:
Kui Shi 2013-10-16 03:23:16 +08:00
parent 2056e57243
commit b63721f2b3

View File

@ -14,13 +14,14 @@
# under the License.
import copy
import httplib
import logging
import os
import six
import socket
import StringIO
import urlparse
from six.moves import http_client as httplib
try:
import ssl
except ImportError:
@ -170,7 +171,7 @@ class HTTPClient(object):
if resp.getheader('content-type', None) != 'application/octet-stream':
body_str = ''.join([chunk for chunk in body_iter])
self.log_http_response(resp, body_str)
body_iter = StringIO.StringIO(body_str)
body_iter = six.StringIO(body_str)
else:
self.log_http_response(resp)