Skip to content

Commit

Permalink
Merge pull request #115 from wrzwicky/wrz_scorecrash
Browse files Browse the repository at this point in the history
Don't crash if scores cannot be saved
  • Loading branch information
Linkid committed Nov 2, 2017
2 parents 909db66 + 50a9ecf commit 1a846a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fofix/game/song/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,11 @@ def save(self):
self._set("scores", self.getObfuscatedScores(part))
self._set("scores_ext", self.getObfuscatedScoresExt(part))

if os.access(os.path.dirname(self.fileName), os.W_OK):
try:
f = open(self.fileName, "w")
except IOError as e:
log.error("Cannot save high scores due to: " + str(e))
else:
self.info.write(f)
f.close()

Expand Down

0 comments on commit 1a846a4

Please sign in to comment.