asyncio doc: socket.socketpair() is not available on Windows yet

This commit is contained in:
Victor Stinner 2014-10-11 16:30:02 +02:00
parent 04e6df330d
commit ccd8e34508
3 changed files with 15 additions and 6 deletions

View file

@ -676,10 +676,13 @@ Wait until a file descriptor received some data using the
:meth:`BaseEventLoop.add_reader` method and then close the event loop::
import asyncio
import socket
try:
from socket import socketpair
except ImportError:
from asyncio.windows_utils import socketpair
# Create a pair of connected file descriptors
rsock, wsock = socket.socketpair()
rsock, wsock = socketpair()
loop = asyncio.get_event_loop()
def reader():