diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-07-05 09:10:58 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-07-05 09:10:58 +0000 |
| commit | 90b6181657eafe1601ee90e4af26cd32cb301fb4 (patch) | |
| tree | edc1c3059895cd90acfcbd31cf1b4aa9196a1cd5 /django/core/cache/__init__.py | |
| parent | 6de65ab76ff7704c90c6de9d5954c7736325c3fb (diff) | |
Fixed #16410 -- Fixed get_cache to behave gracefully when given a string that can't be split. Thanks, jedie.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/cache/__init__.py')
| -rw-r--r-- | django/core/cache/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index b76ddcf038..b97c7469bb 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -126,12 +126,12 @@ def parse_backend_conf(backend, **kwargs): location = args.pop('LOCATION', '') return backend, location, args else: - # Trying to import the given backend, in case it's a dotted path - mod_path, cls_name = backend.rsplit('.', 1) try: + # Trying to import the given backend, in case it's a dotted path + mod_path, cls_name = backend.rsplit('.', 1) mod = importlib.import_module(mod_path) backend_cls = getattr(mod, cls_name) - except (AttributeError, ImportError): + except (AttributeError, ImportError, ValueError): raise InvalidCacheBackendError("Could not find backend '%s'" % backend) location = kwargs.pop('LOCATION', '') return backend, location, kwargs |
