diff options
-rwxr-xr-x | fshare.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -392,6 +392,7 @@ with contextlib.ExitStack() as stack: except BlockingIOError: logger.error('The state directory is already locked by another process') sys.exit(1) + stack.callback(fcntl.flock, state_dir_fd, fcntl.LOCK_UN) try: # read the state file @@ -404,5 +405,3 @@ with contextlib.ExitStack() as stack: except StateCorruptError: logger.error('Corrupted state file') sys.exit(1) - finally: - fcntl.flock(state_dir_fd, fcntl.LOCK_UN) |