From 8710a919afecec802383c8b867ac9c20a6de10ad Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Tue, 9 Apr 2024 00:43:55 +0300 Subject: fix hisghscore file reading --- pyproject.toml | 2 +- src/sliceitoff/hiscores/hiscores.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bd20970..d2dbd5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sliceitoff" -version = "0.3-beta" +version = "0.3-beta.1" description = "Arcade game where one slices play area off avoiding enemies." authors = ["Viljami Ilola <+@hix.fi>"] readme = "README.txt" diff --git a/src/sliceitoff/hiscores/hiscores.py b/src/sliceitoff/hiscores/hiscores.py index 5ce8ced..4b71c1a 100644 --- a/src/sliceitoff/hiscores/hiscores.py +++ b/src/sliceitoff/hiscores/hiscores.py @@ -21,9 +21,9 @@ class HiScores: return with open(self.config_filename, "r", encoding="utf-8") as config_file: for line in config_file: - option, value = line.split('=') - if option == 'hiscore': - score, name = value.split('!') + option, *value = line.split('=') + if option == 'hiscore' and value: + score, name = value[0].split('!') self.add(int(score.strip()),name.strip()) if len(self.table)