Skip to content

Commit

Permalink
Fix lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed Aug 7, 2019
1 parent 3d1c996 commit a131943
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions snoobackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ def backup_lock():
raise FileExistsError("Lock file exists! {}".format(f))

f.touch()
yield
f.unlink()
try:
yield
finally:
f.unlink()


def main():
Expand Down

0 comments on commit a131943

Please sign in to comment.