Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made the lru cache more robust.

--HG--
branch : trunk
  • Loading branch information...
commit e7c72bc235c96dd63abf23a0698f45f79873edf3 1 parent b404439
@mitsuhiko authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 jinja2/utils.py
View
8 jinja2/utils.py
@@ -613,7 +613,7 @@ def __getitem__(self, key):
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 @@ def __delitem__(self, key):
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()
Please sign in to comment.
Something went wrong with that request. Please try again.