Skip to content

Commit

Permalink
lock: add a workaround for a flufl.lock bug (iterative#2688)
Browse files Browse the repository at this point in the history
This bug doesn't affect us during regular dvc CLI commands, but is not
visualy pleasing during API usage.

Fixes iterative#2573
  • Loading branch information
efiop authored Oct 29, 2019
1 parent a48481b commit 877e385
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dvc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ def _set_claimfile(self, pid=None):
self._tmp_dir, filename + ".lock"
)

# Fix for __del__ bug in flufl.lock [1] which is causing errors on
# Python shutdown [2].
# [1] https://gitlab.com/warsaw/flufl.lock/issues/7
# [2] https://github.com/iterative/dvc/issues/2573
def __del__(self):
try:
if self._owned:
self.finalize()
except ImportError:
pass


else:
import zc.lockfile
Expand Down

0 comments on commit 877e385

Please sign in to comment.