Commit 759a9ae3 authored by Antoine Millet's avatar Antoine Millet
Browse files

Handle duplicated locks in Acquires class constructor.

parent 2ab589f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ class Acquires(object):
    '''

    def __init__(self, *locks):
        self._locks = sorted(locks, key=lambda x: id(x))
        self._locks = sorted(set(locks), key=lambda x: id(x))

    def __enter__(self):
        for lock in self._locks: