projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b404439
)
Made the lru cache more robust.
author
Armin Ronacher
<armin.ronacher@active-4.com>
Mon, 14 Sep 2009 19:20:33 +0000
(12:20 -0700)
committer
Armin Ronacher
<armin.ronacher@active-4.com>
Mon, 14 Sep 2009 19:20:33 +0000
(12:20 -0700)
--HG--
branch : trunk
jinja2/utils.py
patch
|
blob
|
history
diff --git
a/jinja2/utils.py
b/jinja2/utils.py
index dc52e0bcae2ee7a475aeae9006b53cd585339d1f..7e5627954b3f850a38acce5c666f697219dd67c6 100644
(file)
--- a/
jinja2/utils.py
+++ b/
jinja2/utils.py
@@
-613,7
+613,7
@@
class LRUCache(object):
if self._queue[-1] != key:
try:
self._remove(key)
- except:
+ except
ValueError
:
# if something removed the key from the container
# when we read, ignore the ValueError that we would
# get otherwise.
@@
-643,7
+643,11
@@
class LRUCache(object):
self._wlock.acquire()
try:
del self._mapping[key]
- self._remove(key)
+ try:
+ self._remove(key)
+ except ValueError:
+ # __getitem__ is not locked, it might happen
+ pass
finally:
self._wlock.release()