From 8de6f18b9dfd105d3be3ede1b5167ad34535d541 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 12 Jan 2009 11:08:26 +0100 Subject: [PATCH] Fixed a threading issue with the LRUCache. Still not sure if I should release a Jinja 2.1.2 for that. --HG-- branch : trunk --- jinja2/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.26.2