aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xyahoozy.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yahoozy.py b/yahoozy.py
index 62b5478..c82a864 100755
--- a/yahoozy.py
+++ b/yahoozy.py
@@ -823,8 +823,11 @@ def loadhist(fp: TextIO, n: int = -1) -> list[LBEntry]:
for i in itertools.count():
if i == n or (line := fp.readline()) == "":
break
- score, name = line.rstrip("\n").split("\x1F")
- xs.append((int(score), name))
+ try:
+ score, name = line.rstrip("\n").split("\x1F")
+ xs.append((int(score), name))
+ except (TypeError, ValueError):
+ pass # Corrupt entry
return xs