Skip to content

Commit b7d1594

Browse files
authored
Changed acquire_timeout to class __call__ method
1 parent e6a313d commit b7d1594

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/labthings/core/lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, timeout=None, name=None):
3333
self.name = name
3434

3535
@contextmanager
36-
def acquire_timeout(self, timeout, blocking=True):
36+
def __call__(self, timeout=sentinel, blocking=True):
3737
result = self.acquire(timeout=timeout, blocking=blocking)
3838
yield result
3939
if result:
@@ -91,7 +91,7 @@ def __init__(self, locks, timeout=None):
9191
self.timeout = timeout
9292

9393
@contextmanager
94-
def acquire_timeout(self, timeout, blocking=True):
94+
def __call__(self, timeout=sentinel, blocking=True):
9595
result = self.acquire(timeout=timeout, blocking=blocking)
9696
yield result
9797
if result:

0 commit comments

Comments
 (0)