From b79892d9e096851fc3f4d594afc509a745167863 Mon Sep 17 00:00:00 2001 From: Lans Zhang Date: Tue, 25 Jul 2017 14:42:46 +0800 Subject: hostkeys: fix raising KeyError in SubDict.__delitem__() If the specified key type is found out, the exception KeyError should not happen. Signed-off-by: Lans Zhang --- paramiko/hostkeys.py | 1 + 1 file changed, 1 insertion(+) diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index d0660cc8..94474e40 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -156,6 +156,7 @@ class HostKeys(MutableMapping): for e in list(self._entries): if e.key.get_name() == key: self._entries.remove(e) + break else: raise KeyError(key) -- cgit v1.2.1