diff options
-rw-r--r-- | redis/_compat.py | 5 | ||||
-rwxr-xr-x | redis/connection.py | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/redis/_compat.py b/redis/_compat.py index ad12543..310611b 100644 --- a/redis/_compat.py +++ b/redis/_compat.py @@ -86,10 +86,6 @@ if sys.version_info[0] < 3: from itertools import imap, izip from string import letters as ascii_letters from Queue import Queue - try: - from cStringIO import StringIO as BytesIO - except ImportError: - from StringIO import StringIO as BytesIO # special unicode handling for python2 to avoid UnicodeDecodeError def safe_unicode(obj, *args): @@ -133,7 +129,6 @@ if sys.version_info[0] < 3: long = long else: from urllib.parse import parse_qs, unquote, urlparse - from io import BytesIO from string import ascii_letters from queue import Queue diff --git a/redis/connection.py b/redis/connection.py index ea65ff0..1e8b86c 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -1,5 +1,6 @@ from distutils.version import StrictVersion from itertools import chain +import io import os import socket import sys @@ -13,7 +14,7 @@ except ImportError: ssl_available = False from redis._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long, - BytesIO, nativestr, basestring, iteritems, + nativestr, basestring, iteritems, LifoQueue, Empty, Full, urlparse, parse_qs, recv, recv_into, select, unquote) from redis.exceptions import ( @@ -152,7 +153,7 @@ class SocketBuffer(object): def __init__(self, socket, socket_read_size): self._sock = socket self.socket_read_size = socket_read_size - self._buffer = BytesIO() + self._buffer = io.BytesIO() # number of bytes written to the buffer from the socket self.bytes_written = 0 # number of bytes read from the buffer |