Skip to content

Commit

Permalink
Merge pull request #5 from zevlee/fix-save-config
Browse files Browse the repository at this point in the history
fix: Add error handling for save_configuration function
  • Loading branch information
zevlee authored Jun 19, 2024
2 parents e27a281 + fd2f94b commit 0ad9809
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions fightsticker/fightstick.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ def load_configuration():


def save_configuration():
with pyglet.resource.file('layout.ini', 'w') as file:
config.write(file)
try:
with pyglet.resource.file('layout.ini', 'w') as file:
config.write(file)
except OSError:
pass


#########################
Expand Down
7 changes: 5 additions & 2 deletions fightsticker/fightstick_hb.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ def load_configuration():


def save_configuration():
with pyglet.resource.file('layouthb.ini', 'w') as file:
config.write(file)
try:
with pyglet.resource.file('layouthb.ini', 'w') as file:
config.write(file)
except OSError:
pass


#########################
Expand Down

0 comments on commit 0ad9809

Please sign in to comment.