From 4843a6a16cad6af441f885f11f8beaf561d42232 Mon Sep 17 00:00:00 2001 From: burris Date: Sun, 23 Feb 2003 00:11:04 +0000 Subject: [PATCH] handle late err messages --- krpc.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.39.5