mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
asyncio: wait_for() now accepts None as timeout (Victor Stinner).
This commit is contained in:
parent
1e9a446ebe
commit
48c66c3dd8
2 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue