summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pysnmp/proto/cache.py3
1 files changed, 2 insertions, 1 deletions
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]