Skip to content
Snippets Groups Projects
Commit 9b154270 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

locking: Append to list outside error handling block


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 56452af7
No related branches found
No related tags found
No related merge requests found
...@@ -895,7 +895,6 @@ class LockSet: ...@@ -895,7 +895,6 @@ class LockSet:
for lname in utils.UniqueSequence(names): for lname in utils.UniqueSequence(names):
try: try:
lock = self.__lockdict[lname] # raises KeyError if lock is not there lock = self.__lockdict[lname] # raises KeyError if lock is not there
acquire_list.append((lname, lock))
except KeyError: except KeyError:
if want_all: if want_all:
# We are acquiring all the set, it doesn't matter if this particular # We are acquiring all the set, it doesn't matter if this particular
...@@ -904,6 +903,8 @@ class LockSet: ...@@ -904,6 +903,8 @@ class LockSet:
raise errors.LockError("Non-existing lock in set (%s)" % lname) raise errors.LockError("Non-existing lock in set (%s)" % lname)
acquire_list.append((lname, lock))
# This will hold the locknames we effectively acquired. # This will hold the locknames we effectively acquired.
acquired = set() acquired = set()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment