Make AcquirerProxy.acquire() support timeout argument

This commit is contained in:
Richard Oudkerk 2012-05-06 16:45:02 +01:00
parent b78174c010
commit 41eb85b194

View file

@ -957,8 +957,9 @@ class IteratorProxy(BaseProxy):
class AcquirerProxy(BaseProxy): class AcquirerProxy(BaseProxy):
_exposed_ = ('acquire', 'release') _exposed_ = ('acquire', 'release')
def acquire(self, blocking=True): def acquire(self, blocking=True, timeout=None):
return self._callmethod('acquire', (blocking,)) args = (blocking,) if timeout is None else (blocking, timeout)
return self._callmethod('acquire', args)
def release(self): def release(self):
return self._callmethod('release') return self._callmethod('release')
def __enter__(self): def __enter__(self):