Ugly fix to prevent importing from failing due to undef positions array.

This commit is contained in:
Ray 2009-07-30 23:42:57 -04:00
parent 4cc3cc2272
commit 29366d3bb6

View File

@ -167,7 +167,12 @@ def mainParser(settings, siteID, category, hand, config, db = None):
except: except:
print "parse: error during commit: " + str(sys.exc_value) print "parse: error during commit: " + str(sys.exc_value)
# HERE's an ugly kludge to keep from failing when positions is undef
# We'll fix this by getting rid of the legacy importer. REB
try:
if positions: pass
except:
positions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
# save data structures in a HandToWrite instance and then insert into database: # save data structures in a HandToWrite instance and then insert into database:
htw = Database.HandToWrite() htw = Database.HandToWrite()
htw.set_all( config, settings, base, category, siteTourneyNo, buyin htw.set_all( config, settings, base, category, siteTourneyNo, buyin