From: burris Date: Sun, 23 Feb 2003 00:11:04 +0000 (+0000) Subject: handle late err messages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4843a6a16cad6af441f885f11f8beaf561d42232;p=quix0rs-apt-p2p.git handle late err messages --- diff --git a/krpc.py b/krpc.py index 63d9887..5f27769 100644 --- a/krpc.py +++ b/krpc.py @@ -91,10 +91,14 @@ class KRPC(basic.NetstringReceiver): elif msg['typ'] == 'err': # if error # lookup tid - df = self.tids[msg['tid']] - # callback - df.errback(msg['err']) - del(self.tids[msg['tid']]) + if self.tids.has_key(msg['tid']): + df = self.tids[msg['tid']] + # callback + df.errback(msg['err']) + del(self.tids[msg['tid']]) + else: + # day late and dollar short + pass else: print "unknown message type " + `msg` # unknown message type