Fixed a threading issue with the LRUCache. Still not sure if I should release a...
authorArmin Ronacher <armin.ronacher@active-4.com>
Mon, 12 Jan 2009 10:08:26 +0000 (11:08 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Mon, 12 Jan 2009 10:08:26 +0000 (11:08 +0100)
--HG--
branch : trunk

jinja2/utils.py

index 5e31779e4016791769c9e363d82eba29fc347322..1ae38e04a1f43f5d5b97fdc403ae7a1772284fbf 100644 (file)
@@ -589,7 +589,13 @@ class LRUCache(object):
         """
         rv = self._mapping[key]
         if self._queue[-1] != key:
-            self._remove(key)
+            try:
+                self._remove(key)
+            except:
+                # if something removed the key from the container
+                # when we read, ignore the ValueError that we would
+                # get otherwise.
+                pass
             self._append(key)
         return rv