25 lines
695 B
Diff
25 lines
695 B
Diff
From 5cf9fbe5096c807668da3c1685c917996b91c960 Mon Sep 17 00:00:00 2001
|
|
From: Duan Pengjie <pengjieduan@gmail.com>
|
|
Date: Wed, 4 Jan 2023 11:51:23 +0800
|
|
Subject: [PATCH] add exists
|
|
|
|
---
|
|
dnf/lock.py | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/dnf/lock.py b/dnf/lock.py
|
|
index ee7a0db..a94132a 100644
|
|
--- a/dnf/lock.py
|
|
+++ b/dnf/lock.py
|
|
@@ -161,6 +161,6 @@ class ProcessLock(object):
|
|
pid = self._try_lock(my_pid)
|
|
|
|
def __exit__(self, *exc_args):
|
|
- if self.count == 1:
|
|
+ if self.count == 1 and os.path.exists(self.target):
|
|
os.unlink(self.target)
|
|
self._unlock_thread()
|
|
--
|
|
2.37.1 (Apple Git-137.1)
|
|
|