From b1ce81da1478715b1d3a8dd6883c5655db0a8f68 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 28 Sep 2018 14:30:55 +0200 Subject: Fixing score fetch for a single-segment match with a towel --- jfr_playoff/matchinfo.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jfr_playoff/matchinfo.py b/jfr_playoff/matchinfo.py index b40d6d1..f726282 100644 --- a/jfr_playoff/matchinfo.py +++ b/jfr_playoff/matchinfo.py @@ -124,11 +124,15 @@ class MatchInfo: in row.select('td.bdcg a')[-1].contents if isinstance(text, unicode)] except IndexError: - # static single-segment - scores = [ - float(text.strip()) for text - in row.select('td.bdc a')[-1].contents - if isinstance(text, unicode)] + try: + # static single-segment + scores = [ + float(text.strip()) for text + in row.select('td.bdc a')[-1].contents + if isinstance(text, unicode)] + except IndexError: + # toweled single-segment + scores = [0.0, 0.0] # carry-over carry_over = [ float(text.strip()) if len(text.strip()) > 0 else 0.0 for text -- cgit v1.2.3