diff --git a/django/core/cache/backends/locmem.py b/django/core/cache/backends/locmem.py index 15a169dc37..b34ce0595c 100644 --- a/django/core/cache/backends/locmem.py +++ b/django/core/cache/backends/locmem.py @@ -96,8 +96,11 @@ class CacheClass(BaseCache): self._lock.writer_enters() try: - del self._cache[key] - del self._expire_info[key] + try: + del self._cache[key] + del self._expire_info[key] + except KeyError: + pass return False finally: self._lock.writer_leaves()