svc/connect.in (Pinger.kill): Don't assume the peer exists.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 Sep 2017 08:04:08 +0000 (09:04 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 14 Jun 2018 09:34:25 +0000 (10:34 +0100)
It's quite possible that it's already gone, so be careful.

svc/connect.in

index e3a5022..feb79ea 100644 (file)
@@ -528,7 +528,8 @@ class Pinger (T.Coroutine):
 
   def kill(me, peername):
     """Remove PEER from the peers being watched by the Pinger."""
-    del me._peers[peername]
+    try: del me._peers[peername]
+    except KeyError: pass
     return me
 
   def rescan(me, startup):