summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-08 09:59:43 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-08 09:59:43 +0000
commit392f81cba91310a93409c7b83a507c69736a19d2 (patch)
treed29979078fe3c45a5ad0f90f1aa3f8847d01b467
parent6e415a5f90dc89e83b0e926f973c629b56642a9c (diff)
Fixed #9626 -- Fixed a deletion race in the locmem cache.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/cache/backends/locmem.py7
1 files changed, 5 insertions, 2 deletions
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()