diff options
-rw-r--r-- | kazoo/recipe/lock.py | 4 | ||||
-rw-r--r-- | kazoo/recipe/queue.py | 2 | ||||
-rw-r--r-- | kazoo/testing/harness.py | 4 | ||||
-rw-r--r-- | kazoo/tests/test_lock.py | 8 |
4 files changed, 9 insertions, 9 deletions
diff --git a/kazoo/recipe/lock.py b/kazoo/recipe/lock.py index 7722a97..8bcc236 100644 --- a/kazoo/recipe/lock.py +++ b/kazoo/recipe/lock.py @@ -276,7 +276,7 @@ class Lock(object): pass # predecessor has already been deleted else: self.wake_event.wait(timeout) - if not self.wake_event.isSet(): + if not self.wake_event.is_set(): raise LockTimeout( "Failed to acquire lock on %s after %s seconds" % (self.path, timeout) @@ -638,7 +638,7 @@ class Semaphore(object): # If blocking, wait until self._watch_lease_change() is # called before returning self.wake_event.wait(w.leftover()) - if not self.wake_event.isSet(): + if not self.wake_event.is_set(): raise LockTimeout( "Failed to acquire semaphore on %s" " after %s seconds" % (self.path, timeout) diff --git a/kazoo/recipe/queue.py b/kazoo/recipe/queue.py index 5fd7f89..3887973 100644 --- a/kazoo/recipe/queue.py +++ b/kazoo/recipe/queue.py @@ -292,7 +292,7 @@ class LockingQueue(BaseQueue): if event is not None and event.type != EventType.CHILD: return with lock: - if canceled or flag.isSet(): + if canceled or flag.is_set(): return values = self.client.retry( self.client.get_children, diff --git a/kazoo/testing/harness.py b/kazoo/testing/harness.py index ce8748a..4cd419d 100644 --- a/kazoo/testing/harness.py +++ b/kazoo/testing/harness.py @@ -229,11 +229,11 @@ class KazooTestHarness(unittest.TestCase): self.client._call(break_event, None) lost.wait(5) - if not lost.isSet(): + if not lost.is_set(): raise Exception("Failed to get notified of broken connection.") safe.wait(15) - if not safe.isSet(): + if not safe.is_set(): raise Exception("Failed to see client reconnect.") self.client.retry(self.client.get_async, '/') diff --git a/kazoo/tests/test_lock.py b/kazoo/tests/test_lock.py index 0e16949..edfdb90 100644 --- a/kazoo/tests/test_lock.py +++ b/kazoo/tests/test_lock.py @@ -397,7 +397,7 @@ class KazooLockTests(KazooTestCase): with lock: started.set() event.wait(timeout) - if not event.isSet(): + if not event.is_set(): # Eventually fail to avoid hanging the tests self.fail("lock2 never timed out") @@ -409,7 +409,7 @@ class KazooLockTests(KazooTestCase): client2 = self._get_client() client2.start() started.wait(5) - assert started.isSet() is True + assert started.is_set() is True lock2 = client2.Lock(self.lockpath, "two") try: lock2.acquire(timeout=timeout) @@ -712,7 +712,7 @@ class TestSemaphore(KazooTestCase): with sem: started.set() event.wait(timeout) - if not event.isSet(): + if not event.is_set(): # Eventually fail to avoid hanging the tests self.fail("sem2 never timed out") @@ -724,7 +724,7 @@ class TestSemaphore(KazooTestCase): client2 = self._get_client() client2.start() started.wait(5) - assert started.isSet() is True + assert started.is_set() is True sem2 = client2.Semaphore(self.lockpath, "two") try: sem2.acquire(timeout=timeout) |