diff --git a/stdlib/2and3/asyncore.pyi b/stdlib/2and3/asyncore.pyi index b93bd6c58..3045e6f19 100644 --- a/stdlib/2and3/asyncore.pyi +++ b/stdlib/2and3/asyncore.pyi @@ -1,18 +1,10 @@ -from typing import Tuple, Union, Optional, Any, Dict, overload +from typing import Tuple, Union, Any, Dict, overload -import os -import select import sys -import time -import warnings from socket import SocketType from typing import Optional from _types import FileDescriptorLike -from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, - ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, - EPIPE, EAGAIN, errorcode) - # cyclic dependence with asynchat _maptype = Dict[int, Any] @@ -121,26 +113,25 @@ class dispatcher_with_send(dispatcher): def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ... def close_all(map: Optional[_maptype] = ..., ignore_all: bool = ...) -> None: ... -# if os.name == 'posix': -# import fcntl -class file_wrapper: - fd: int +if sys.platform != "win32": + class file_wrapper: + fd: int - def __init__(self, fd: int) -> None: ... - def recv(self, bufsize: int, flags: int = ...) -> bytes: ... - def send(self, data: bytes, flags: int = ...) -> int: ... + def __init__(self, fd: int) -> None: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def send(self, data: bytes, flags: int = ...) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - def read(self, bufsize: int, flags: int = ...) -> bytes: ... - def write(self, data: bytes, flags: int = ...) -> int: ... + def read(self, bufsize: int, flags: int = ...) -> bytes: ... + def write(self, data: bytes, flags: int = ...) -> int: ... - def close(self) -> None: ... - def fileno(self) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... -class file_dispatcher(dispatcher): - def __init__(self, fd: FileDescriptorLike, map: Optional[_maptype] = ...) -> None: ... - def set_file(self, fd: int) -> None: ... + class file_dispatcher(dispatcher): + def __init__(self, fd: FileDescriptorLike, map: Optional[_maptype] = ...) -> None: ... + def set_file(self, fd: int) -> None: ...