Commit 2a21bc88 authored by Iustin Pop's avatar Iustin Pop
Browse files

locking.LockSet: don't modify input arguments

Currently LockSet.acquire() sorts in place it's input argument if it's a
list. This is not good, since callers might depend on a specific
ordering of the input data, and this is a 'hidden' modification.

We fix it by simply using a sorted copy, instead of sorting in place.

Reviewed-by: ultrotter
parent f12eadb3
......@@ -451,7 +451,7 @@ class LockSet:
if isinstance(names, basestring):
names = [names]
else:
names.sort()
names = sorted(names)
acquire_list = []
# First we look the locks up on __lockdict. We have no way of being sure
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment