From d8a12c258cbe15b2725c51b1061e8297919b20df Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 11 Mar 2021 04:28:15 -0800 Subject: [PATCH] _test_lock_fn: remove temp file (bug 775239) Bug: https://bugs.gentoo.org/775239 Signed-off-by: Zac Medico --- lib/portage/locks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/portage/locks.py b/lib/portage/locks.py index ddce72f621..d0218d7bc1 100644 --- a/lib/portage/locks.py +++ b/lib/portage/locks.py @@ -113,6 +113,10 @@ def _test_lock(fd, lock_path): # the test passed return True finally: + try: + os.unlink(lock_path) + except OSError: + pass if unlock_fn is not None: unlock_fn() return False