summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-09-28 14:30:55 +0200
committeremkael <emkael@tlen.pl>2018-09-28 14:30:55 +0200
commitb1ce81da1478715b1d3a8dd6883c5655db0a8f68 (patch)
tree49439a9c6319b4b72519e0efe769516d32dc9437 /jfr_playoff
parent528bbb28fafdef9aa107149fa5f2a90dccfa00f9 (diff)
Fixing score fetch for a single-segment match with a towel
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/matchinfo.py14
1 files 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