diff options
author | Guido van Rossum <guido@python.org> | 2014-01-29 22:30:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-01-29 22:30:38 (GMT) |
commit | 48c66c3dd82e0f345350f99d0c8713cc1e686939 (patch) | |
tree | 4904cb5bc3c35915d815720f3c7d911c07ecb819 /Lib/asyncio/tasks.py | |
parent | 1e9a446ebeced921a5da3d9647e96cdd767504a9 (diff) | |
download | cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.zip cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.tar.gz cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.tar.bz2 |
asyncio: wait_for() now accepts None as timeout (Victor Stinner).
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r-- | Lib/asyncio/tasks.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index b52933f..38ffec1 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -394,6 +394,9 @@ def wait_for(fut, timeout, *, loop=None): if loop is None: loop = events.get_event_loop() + if timeout is None: + return (yield from fut) + waiter = futures.Future(loop=loop) timeout_handle = loop.call_later(timeout, _release_waiter, waiter, False) cb = functools.partial(_release_waiter, waiter, True) |