docs/asyncio: Document new ensure_future() and deprecated async() · pythoncapi/cpython@d7e19bb · GitHub
Skip to content

Commit d7e19bb

Browse files
author
Yury Selivanov
committed
docs/asyncio: Document new ensure_future() and deprecated async()
1 parent 7185461 commit d7e19bb

3 files changed

Lines changed: 28 additions & 20 deletions

File tree

Doc/library/asyncio-dev.rst

Lines changed: 13 additions & 13 deletions

Doc/library/asyncio-stream.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Simple example querying HTTP headers of the URL passed on the command line::
364364

365365
url = sys.argv[1]
366366
loop = asyncio.get_event_loop()
367-
task = asyncio.async(print_http_headers(url))
367+
task = asyncio.ensure_future(print_http_headers(url))
368368
loop.run_until_complete(task)
369369
loop.close()
370370

Doc/library/asyncio-task.rst

Lines changed: 14 additions & 6 deletions

0 commit comments

Comments
 (0)