diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-08 10:02:23 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-08 10:02:23 +0000 |
| commit | b1fd7650a9f44e3a31b50e1b1393d931ceba57fe (patch) | |
| tree | 16b818418d07bdaa1178ee2bd1e70bd163fa3554 | |
| parent | 055c01103de70b1f08321b1dbbcbc4da84821a79 (diff) | |
[1.0.X] Fixed #9626 -- Fixed a deletion race in the locmem cache.
Backport of r9998 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/cache/backends/locmem.py | 7 |
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() |
