mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Fix stubtest failures for asyncore on windows, remove unnecessary imports (#4093)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user