asyncio doc: socket.socketpair() is not available on Windows yet
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index 9db2380..c3bbd20 100644
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -296,11 +296,14 @@
:func:`open_connection` function::
import asyncio
- import socket
+ try:
+ from socket import socketpair
+ except ImportError:
+ from asyncio.windows_utils import socketpair
def wait_for_data(loop):
# Create a pair of connected sockets
- rsock, wsock = socket.socketpair()
+ rsock, wsock = socketpair()
# Register the open socket to wait for data
reader, writer = yield from asyncio.open_connection(sock=rsock, loop=loop)