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
1 changed files with 3 additions and 2 deletions

View File

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