bpo-34335: Use async/await syntax in documentation examples (GH-8674)

(cherry picked from commit d2ac400267)

Co-authored-by: Mikhail Terekhov <termim@gmail.com>
This commit is contained in:
Miss Islington (bot) 2018-08-07 13:33:31 -07:00 committed by GitHub
parent 7bd52a1564
commit fac49762c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

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

View File

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