From 9953e76c9e1e8566e79e9c02acaa35aa6ccdf57e Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Mon, 30 Nov 2009 09:51:47 -0500 Subject: [PATCH] trap IOError on hud pipe write when hud closed without autoimport stopping, turn off hud --- pyfpdb/fpdb_import.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 541b018f..d735de04 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -564,7 +564,11 @@ class Importer: #print "call to HUD here. handsId:",handsId #pipe the Hands.id out to the HUD # print "fpdb_import: sending hand to hud", handsId, "pipe =", self.caller.pipe_to_hud - self.caller.pipe_to_hud.stdin.write("%s" % (handsId) + os.linesep) + try: + self.caller.pipe_to_hud.stdin.write("%s" % (handsId) + os.linesep) + except IOError: # hud closed + self.callHud = False + pass # continue import without hud except Exceptions.DuplicateError: duplicates += 1 db.rollback()