trap IOError on hud pipe write when hud closed without autoimport stopping, turn off hud

This commit is contained in:
Eric Blade 2009-11-30 09:51:47 -05:00
parent 8c8fdba7c8
commit 9953e76c9e

View File

@ -564,7 +564,11 @@ class Importer:
#print "call to HUD here. handsId:",handsId #print "call to HUD here. handsId:",handsId
#pipe the Hands.id out to the HUD #pipe the Hands.id out to the HUD
# print "fpdb_import: sending hand to hud", handsId, "pipe =", self.caller.pipe_to_hud # print "fpdb_import: sending hand to hud", handsId, "pipe =", self.caller.pipe_to_hud
try:
self.caller.pipe_to_hud.stdin.write("%s" % (handsId) + os.linesep) 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: except Exceptions.DuplicateError:
duplicates += 1 duplicates += 1
db.rollback() db.rollback()