Commit d2ac4002 authored by Mikhail Terekhov's avatar Mikhail Terekhov Committed by Mariatta

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

parent b221c93d
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment