dict might change, pull into list

This commit is contained in:
j 2016-02-18 12:03:14 +05:30
parent 7f0d5efccd
commit 9dda2f7303

View file

@ -8,7 +8,7 @@ class Cache(dict):
def get(self, key): def get(self, key):
now = time.time() now = time.time()
for key, value in self._added.items(): for key, value in list(self._added.items()):
if value < now: if value < now:
del self._added[key] del self._added[key]
del self[key] del self[key]