Comments
Patch
@@ -41,7 +41,6 @@
# Many functions in this file have too many arguments.
# pylint: disable=R0913
-import cStringIO
import errno
import httplib
import logging
@@ -49,6 +48,11 @@
import select
import socket
+try:
+ import cStringIO as io
+except ImportError:
+ import io
+
from . import (
_readers,
socketutil,
@@ -242,7 +246,7 @@
self.status = int(self.status)
if self._eol != EOL:
hdrs = hdrs.replace(self._eol, '\r\n')
- headers = rfc822.Message(cStringIO.StringIO(hdrs))
+ headers = rfc822.Message(io.StringIO(hdrs))
content_len = None
if HDR_CONTENT_LENGTH in headers:
content_len = int(headers[HDR_CONTENT_LENGTH])