tcatch exception when client is disconnected - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 4038b81a2239fd85b89f3d6124d01f02379ca475 (DIR) parent 8e95706763b542062ec818fe88d7dd635448a3ab (HTM) Author: thomasv <thomasv@gitorious> Date: Mon, 22 Oct 2012 14:56:59 +0200 catch exception when client is disconnected Diffstat: M lib/interface.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- (DIR) diff --git a/lib/interface.py b/lib/interface.py t@@ -295,8 +295,13 @@ class Interface(threading.Thread): self.message_id += 1 out += request + '\n' while out: - sent = self.s.send( out ) - out = out[sent:] + try: + sent = self.s.send( out ) + out = out[sent:] + except: + # this happens when we get disconnected + print "Not connected, cannot send" + return None return ids