summaryrefslogtreecommitdiff
path: root/bin/tools/misc.py
diff options
context:
space:
mode:
authorOlivier Laurent <olt@tinyerp.com>2009-07-18 13:21:10 +0200
committerOlivier Laurent <olt@tinyerp.com>2009-07-18 13:21:10 +0200
commit22ac7ba66eae2d53ded9a1dc46d9e1078db313d2 (patch)
treeb0fa4c0837a2a078846c7670e4c8722ea2148e5d /bin/tools/misc.py
parent9b8f222fd9abebc127e30660003c15cf072d2b81 (diff)
[FIX] RuntimeError in the cache system
lp bug: https://launchpad.net/bugs/310918 fixed bzr revid: olt@tinyerp.com-20090718112110-0p29jjruvhiwjrp0
Diffstat (limited to 'bin/tools/misc.py')
-rw-r--r--bin/tools/misc.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/tools/misc.py b/bin/tools/misc.py
index a2712ee006e..9d4ea4d66cd 100644
--- a/bin/tools/misc.py
+++ b/bin/tools/misc.py
@@ -659,9 +659,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.keys():
- 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]
kwargs2 = self._unify_args(*args, **kwargs)