aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2021-03-11 04:28:15 -0800
committerZac Medico <zmedico@gentoo.org>2021-03-11 04:29:14 -0800
commitd8a12c258cbe15b2725c51b1061e8297919b20df (patch)
tree6166f6d9f0e63af6e0086a72113d50773f7a8294
parentUse atomic_ofstream as Context Manager i.e., with-statement contexts (diff)
downloadportage-d8a12c258cbe15b2725c51b1061e8297919b20df.tar.gz
portage-d8a12c258cbe15b2725c51b1061e8297919b20df.tar.bz2
portage-d8a12c258cbe15b2725c51b1061e8297919b20df.zip
_test_lock_fn: remove temp file (bug 775239)
Bug: https://bugs.gentoo.org/775239 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/locks.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/portage/locks.py b/lib/portage/locks.py
index ddce72f62..d0218d7bc 100644
--- a/lib/portage/locks.py
+++ b/lib/portage/locks.py
@@ -113,6 +113,10 @@ def _test_lock_fn(lock_fn: typing.Callable[[str, int, int], typing.Callable[[],
# the test passed
return True
finally:
+ try:
+ os.unlink(lock_path)
+ except OSError:
+ pass
if unlock_fn is not None:
unlock_fn()
return False