bpo-34335: Use async/await syntax in documentation examples (GH-8674)
(cherry picked from commit d2ac400267940f35d731d66c2dafafe099d770d9)
Co-authored-by: Mikhail Terekhov <termim@gmail.com>
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index 8f94ba7..f662e72 100644
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -431,8 +431,7 @@
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)