Commit 6bdf918d authored by Sean Bleier's avatar Sean Bleier

Merge pull request #94 from carltongibson/fix-93-RemovedInDjango19Warning

Update import of importlib
parents 152afe02 26e67cd4
import warnings import warnings
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from redis.connection import SSLConnection from redis.connection import SSLConnection
from redis_cache.compat import ( from redis_cache.compat import (
smart_text, python_2_unicode_compatible, parse_qs, urlparse smart_text, python_2_unicode_compatible, parse_qs, urlparse
) )
try:
import importlib
except ImportError:
from django.utils import importlib
try: try:
basestring basestring
except NameError: except NameError:
...@@ -53,7 +57,7 @@ def get_servers(location): ...@@ -53,7 +57,7 @@ def get_servers(location):
def import_class(path): def import_class(path):
module_name, class_name = path.rsplit('.', 1) module_name, class_name = path.rsplit('.', 1)
try: try:
module = import_module(module_name) module = importlib.import_module(module_name)
except ImportError: except ImportError:
raise ImproperlyConfigured('Could not find module "%s"' % module_name) raise ImproperlyConfigured('Could not find module "%s"' % module_name)
else: else:
......
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