lock: add a workaround for a flufl.lock bug (#2688)

This bug doesn't affect us during regular dvc CLI commands, but is not
visualy pleasing during API usage.

Fixes #2573
This commit is contained in:
Ruslan Kuprieiev
2019-10-29 20:54:56 +02:00
committed by GitHub
parent a48481b01f
commit 877e38551e
+11
View File
@@ -87,6 +87,17 @@ if is_py3:
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