From 392f81cba91310a93409c7b83a507c69736a19d2 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 8 Mar 2009 09:59:43 +0000 Subject: [PATCH] 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 --- django/core/cache/backends/locmem.py | 7 +++++-- 1 file 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()