diff --git a/src/disco.py b/src/disco.py index a3e2343ba..2825107c9 100644 --- a/src/disco.py +++ b/src/disco.py @@ -133,7 +133,8 @@ class CacheDictionary: def _expire_timeout(self, key): '''The timeout has expired, remove the object.''' - del self.cache[key] + if key in self.cache: + del self.cache[key] return False def _refresh_timeout(self, key):