From dc6296ff722b3a45915d88bd76aff7bcfe0df2d9 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 19 Nov 2012 17:14:44 +0100 Subject: [PATCH] locking: Simplify condition Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/locking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/locking.py b/lib/locking.py index 014b37850..cf7af3499 100644 --- a/lib/locking.py +++ b/lib/locking.py @@ -1050,8 +1050,8 @@ class LockSet: self.__owners[threading.currentThread()].remove(name) # Only remove the key if we don't hold the set-lock as well - if (not self.__lock.is_owned() and - not self.__owners[threading.currentThread()]): + if not (self.__lock.is_owned() or + self.__owners[threading.currentThread()]): del self.__owners[threading.currentThread()] def list_owned(self): -- GitLab