[FIX] RuntimeError in the cache system

lp bug: https://launchpad.net/bugs/310918 fixed

bzr revid: christophe@cobalt-20081223151350-aw44igucwyldnhwr
This commit is contained in:
Christophe Simonis 2008-12-23 16:13:50 +01:00
parent f4a6b51fb4
commit 66e03f2f50
1 changed files with 3 additions and 3 deletions

View File

@ -552,9 +552,9 @@ class cache(object):
if time.time()-self.timeout > self.lasttime:
self.lasttime = time.time()
t = time.time()-self.timeout
for key in self.cache:
if self.cache[key][1]<t:
del self.cache[key]
old_keys = [key for key in self.cache if self.cache[key][1] < t]
for key in old_keys:
del self.cache[key]
if cr is None:
self.cache = {}