summaryrefslogtreecommitdiffstats
path: root/Doc/library/asyncio-protocol.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-10-11 14:30:02 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-10-11 14:30:02 (GMT)
commitccd8e34508c29f0a87fd41a5b0f1145ae405966e (patch)
tree2b5621ae971bcbb7e25ab0cee199825c41a60940 /Doc/library/asyncio-protocol.rst
parent04e6df330ddbec28cbbcba0f36235040e267692d (diff)
downloadcpython-ccd8e34508c29f0a87fd41a5b0f1145ae405966e.zip
cpython-ccd8e34508c29f0a87fd41a5b0f1145ae405966e.tar.gz
cpython-ccd8e34508c29f0a87fd41a5b0f1145ae405966e.tar.bz2
asyncio doc: socket.socketpair() is not available on Windows yet
Diffstat (limited to 'Doc/library/asyncio-protocol.rst')
-rw-r--r--Doc/library/asyncio-protocol.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
index 3fa2f3e..52da1b4 100644
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -521,10 +521,13 @@ Wait until a socket receives data using the
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 sockets
- rsock, wsock = socket.socketpair()
+ rsock, wsock = socketpair()
loop = asyncio.get_event_loop()
class MyProtocol(asyncio.Protocol):