From: Armin Ronacher Date: Mon, 12 Jan 2009 10:08:26 +0000 (+0100) Subject: Fixed a threading issue with the LRUCache. Still not sure if I should release a... X-Git-Tag: 2.2~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8de6f18b9dfd105d3be3ede1b5167ad34535d541;p=jinja2.git Fixed a threading issue with the LRUCache. Still not sure if I should release a Jinja 2.1.2 for that. --HG-- branch : trunk --- diff --git a/jinja2/utils.py b/jinja2/utils.py index 5e31779..1ae38e0 100644 --- a/jinja2/utils.py +++ b/jinja2/utils.py @@ -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