From 5807582fd35cefc654ab81373f2d8bd660552464 Mon Sep 17 00:00:00 2001 From: elie Date: Fri, 30 Jan 2015 22:22:12 +0000 Subject: ignore expired entries in expire() --- pysnmp/proto/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pysnmp/proto/cache.py b/pysnmp/proto/cache.py index f4bb6b3..6efba88 100644 --- a/pysnmp/proto/cache.py +++ b/pysnmp/proto/cache.py @@ -27,5 +27,6 @@ class Cache: for index, cachedParams in list(self.__cacheRepository.items()): if cbFun: if cbFun(index, cachedParams, cbCtx): - del self.__cacheRepository[index] + if index in self.__cacheRepository: + del self.__cacheRepository[index] -- cgit v1.2.1