Skip to content

Commit

Permalink
app: don't neglect to close the config file after writing it
Browse files Browse the repository at this point in the history
  • Loading branch information
koreno committed Sep 5, 2018
1 parent f30d0c1 commit 8775529
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions termenu/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def __init__(self, message="", *args, **kwargs):
app_chars = f.read()
except FileNotFoundError:
os.makedirs(os.path.dirname(CFG_PATH), exist_ok=True)
f = open(CFG_PATH, "w")
f.write(DEFAULT_CONFIG)
with open(CFG_PATH, "w") as f:
f.write(DEFAULT_CONFIG)

app_chars = DEFAULT_CONFIG
if sys.__stdin__.isatty():
os.system("clear")
Expand Down

0 comments on commit 8775529

Please sign in to comment.