commit:     d8a12c258cbe15b2725c51b1061e8297919b20df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 11 12:28:15 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 11 12:29:14 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d8a12c25

_test_lock_fn: remove temp file (bug 775239)

Bug: https://bugs.gentoo.org/775239
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/locks.py | 4 ++++
 1 file changed, 4 insertions(+)

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

Reply via email to