diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-05-06 15:45:02 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-05-06 15:45:02 (GMT) |
commit | 41eb85b194909d68bb05b81442f10026b9279560 (patch) | |
tree | 06693577ef7be741d07a121ffdc9597f5f67163c /Lib/multiprocessing | |
parent | b78174c01071d4166a8f5dff47f5c46563dfd3d4 (diff) | |
download | cpython-41eb85b194909d68bb05b81442f10026b9279560.zip cpython-41eb85b194909d68bb05b81442f10026b9279560.tar.gz cpython-41eb85b194909d68bb05b81442f10026b9279560.tar.bz2 |
Make AcquirerProxy.acquire() support timeout argument
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/managers.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index dc8166a..36bcf8f 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -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): |