Commit f92c0eca authored by Tim Graham's avatar Tim Graham

Use six rather than redis_cache.compat

parent 918fe0b7
import sys
PY3 = (sys.version_info >= (3,))
try:
# Django 1.5+
from django.utils.encoding import smart_text, smart_bytes
......@@ -11,10 +6,3 @@ except ImportError:
from django.utils.encoding import smart_unicode, smart_str
smart_text = smart_unicode
smart_bytes = smart_str
if PY3:
bytes_type = bytes
from urllib.parse import parse_qs, urlparse
else:
bytes_type = str
from urlparse import parse_qs, urlparse
......@@ -2,15 +2,13 @@ import importlib
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from redis.connection import SSLConnection
from django.utils.six.moves.urllib.parse import parse_qs, urlparse
from redis_cache.compat import smart_text, parse_qs, urlparse
from redis.connection import SSLConnection
try:
basestring
except NameError:
basestring = str
from redis_cache.compat import smart_text
@python_2_unicode_compatible
......@@ -38,7 +36,7 @@ def get_servers(location):
"""Returns a list of servers given the server argument passed in from
Django.
"""
if isinstance(location, basestring):
if isinstance(location, six.string_types):
servers = location.split(',')
elif hasattr(location, '__iter__'):
servers = location
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment