diff --git a/stdlib/3.4/asyncio/__init__.pyi b/stdlib/3.4/asyncio/__init__.pyi index 3f88dac01..2364ff6cf 100644 --- a/stdlib/3.4/asyncio/__init__.pyi +++ b/stdlib/3.4/asyncio/__init__.pyi @@ -1,5 +1,6 @@ """The asyncio package, tracking PEP 3156.""" +import socket import sys from typing import Type @@ -85,6 +86,11 @@ from asyncio.locks import ( if sys.version_info < (3, 5): from asyncio.queues import JoinableQueue as JoinableQueue +if sys.platform != 'win32': + from asyncio.streams import ( + open_unix_connection as open_unix_connection, + start_unix_server as start_unix_server, + ) # TODO: It should be possible to instantiate these classes, but mypy # currently disallows this. diff --git a/stdlib/3.4/asyncio/streams.pyi b/stdlib/3.4/asyncio/streams.pyi index 21f468bd0..fd677ab75 100644 --- a/stdlib/3.4/asyncio/streams.pyi +++ b/stdlib/3.4/asyncio/streams.pyi @@ -1,4 +1,4 @@ -import socket +import sys from typing import Any, Awaitable, Callable, Generator, Iterable, Optional, Tuple from . import coroutines @@ -38,7 +38,7 @@ def start_server( **kwds: Any ) -> Generator[Any, None, events.AbstractServer]: ... -if hasattr(socket, 'AF_UNIX'): +if sys.platform != 'win32': @coroutines.coroutine def open_unix_connection( path: str = ...,