asyncio: Cleanup Future API

See https://github.com/python/asyncio/pull/292 for details.
This commit is contained in:
Yury Selivanov 2015-11-17 12:19:41 -05:00
parent 0013ccedd1
commit 5d7e3b6cd2
6 changed files with 49 additions and 40 deletions

View file

@ -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: