From b2edb57f34e903b461d1d5a4f94938a320331cef Mon Sep 17 00:00:00 2001 From: Mikhail Terekhov Date: Sat, 4 Aug 2018 19:00:59 -0400 Subject: [PATCH] bpo-34335: Do not mix @asyncio.coroutine decorator and await in asyncio docs --- Doc/library/asyncio-stream.rst | 3 +-- Doc/library/asyncio-subprocess.rst | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst index 8f94ba76aef2e23..f662e7223337255 100644 --- a/Doc/library/asyncio-stream.rst +++ b/Doc/library/asyncio-stream.rst @@ -431,8 +431,7 @@ Simple example querying HTTP headers of the URL passed on the command line:: import urllib.parse import sys - @asyncio.coroutine - def print_http_headers(url): + async def print_http_headers(url): url = urllib.parse.urlsplit(url) if url.scheme == 'https': connect = asyncio.open_connection(url.hostname, 443, ssl=True) diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst index 280b76400374cbd..60e174574b04e90 100644 --- a/Doc/library/asyncio-subprocess.rst +++ b/Doc/library/asyncio-subprocess.rst @@ -392,8 +392,7 @@ function:: import asyncio.subprocess import sys - @asyncio.coroutine - def get_date(): + async def get_date(): code = 'import datetime; print(datetime.datetime.now())' # Create the subprocess, redirect the standard output into a pipe