diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sliceitoff/hiscores/hiscores.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sliceitoff/hiscores/hiscores.py b/src/sliceitoff/hiscores/hiscores.py index d963605..b981077 100644 --- a/src/sliceitoff/hiscores/hiscores.py +++ b/src/sliceitoff/hiscores/hiscores.py @@ -9,8 +9,11 @@ class HiScores: """ On creation load high scores from config file """ self.table=[] for value in settings.get_values("hiscore"): - score, name = value.split('!') - self.add(int(score.strip()),name.strip()) + try: + score, name = value.split('!') + self.add(int(score.strip()),name.strip()) + except ValueError: + pass if len(self.table)<MAX_HIGHSCORES: self.table+=[(0,"") for _ in range(MAX_HIGHSCORES-len(self.table))] |