mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
asyncio: Cleanup Future API
See https://github.com/python/asyncio/pull/292 for details.
This commit is contained in:
parent
0013ccedd1
commit
5d7e3b6cd2
6 changed files with 49 additions and 40 deletions
|
@ -500,7 +500,8 @@ def sleep(delay, result=None, *, loop=None):
|
|||
|
||||
future = futures.Future(loop=loop)
|
||||
h = future._loop.call_later(delay,
|
||||
future._set_result_unless_cancelled, result)
|
||||
futures._set_result_unless_cancelled,
|
||||
future, result)
|
||||
try:
|
||||
return (yield from future)
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue