Skip to content

Commit

Permalink
Update src/imgtools/io/writers/abstract_base_writer.py
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
jjjermiah and coderabbitai[bot] authored Jan 17, 2025
1 parent 32209e8 commit 12137eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/imgtools/io/writers/abstract_base_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ def __exit__(
logger.debug(f"Exiting context manager for {self.__class__.__name__}")
if self.index_file.exists():
logger.debug(f"Removing lock file {self._get_index_lock()}")
self._get_index_lock().unlink()
lock_file = self._get_index_lock()
if lock_file.exists():
lock_file.unlink()

# if the root directory is empty, aka we created it but didn't write anything, delete it
if (
Expand Down

0 comments on commit 12137eb

Please sign in to comment.