Преглед на файлове

Django raises InvalidCacheBackendClass not ImportError :(

Ask Solem преди 15 години
родител
ревизия
0131f243d4
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      celery/backends/cache.py

+ 2 - 1
celery/backends/cache.py

@@ -32,9 +32,10 @@ class DjangoMemcacheWrapper(object):
 # Check if django is using memcache as the cache backend. If so, wrap the
 # cache object in a DjangoMemcacheWrapper that fixes a bug with retrieving
 # pickled data
+from django.core.cache.backends.base import InvalidCacheBackendError
 try:
     from django.core.cache.backends.memcached import CacheClass
-except ImportError:
+except InvalidCacheBackendError:
     pass
 else:
     if isinstance(cache, CacheClass):