FTP: Add exception handler to readButton

Fix crasher in FTP (see 927184a3f2)
This commit is contained in:
Worros 2011-01-12 11:47:42 +08:00
parent 927184a3f2
commit 70c4c5fada

View File

@ -367,7 +367,11 @@ class Fulltilt(HandHistoryConverter):
logging.warning(_("No bringin found, handid =%s") % hand.handid)
def readButton(self, hand):
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
try:
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
except AttributeError, e:
# FTP has no indication that a hand is cancelled.
raise FpdbParseError(_("FTP: readButton: Failed to detect button (hand #%s cancelled?)") % hand.handid)
def readHeroCards(self, hand):
# streets PREFLOP, PREDRAW, and THIRD are special cases beacause