diff --git a/stdlib/_msi.pyi b/stdlib/_msi.pyi index 2fdbdfd0e9f4..160406a6d8d5 100644 --- a/stdlib/_msi.pyi +++ b/stdlib/_msi.pyi @@ -1,6 +1,7 @@ import sys if sys.platform == "win32": + class MSIError(Exception): ... # Actual typename View, not exposed by the implementation class _View: def Execute(self, params: _Record | None = ...) -> None: ... diff --git a/stdlib/msilib/text.pyi b/stdlib/msilib/text.pyi index 1353cf8a2392..441c843ca6cf 100644 --- a/stdlib/msilib/text.pyi +++ b/stdlib/msilib/text.pyi @@ -3,5 +3,5 @@ import sys if sys.platform == "win32": ActionText: list[tuple[str, str, str | None]] UIText: list[tuple[str, str | None]] - + dirname: str tables: list[str] diff --git a/stdlib/selectors.pyi b/stdlib/selectors.pyi index 90a923f09355..43e3b1c507f6 100644 --- a/stdlib/selectors.pyi +++ b/stdlib/selectors.pyi @@ -59,12 +59,13 @@ class DevpollSelector(BaseSelector): def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... -class KqueueSelector(BaseSelector): - def fileno(self) -> int: ... - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... - def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... +if sys.platform != "win32": + class KqueueSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class DefaultSelector(BaseSelector): def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index 346e4d5513d8..1013db7ee984 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -2600,6 +2600,7 @@ if sys.platform == "win32": hStdError: Any | None wShowWindow: int lpAttributeList: Mapping[str, Any] + def copy(self) -> STARTUPINFO: ... from _winapi import ( ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS, diff --git a/tests/stubtest_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index a556ceacf505..0e7e214e134f 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -4,11 +4,8 @@ locale.nl_langinfo # Function that should be moved to _locale and re-exported c # alias for a class defined elsewhere, # mypy infers the variable has type `(*args) -> DupHandle` but stubtest infers the runtime type as multiprocessing.reduction.AbstractReducer.DupHandle -msilib.text.dirname -selectors.KqueueSelector # Exists at runtime, but missing from stubs -_msi.MSIError _winapi.CreateFileMapping _winapi.MapViewOfFile _winapi.OpenFileMapping @@ -21,7 +18,6 @@ msvcrt.SetErrorMode ssl.SSLSocket.recvmsg ssl.SSLSocket.recvmsg_into ssl.SSLSocket.sendmsg -subprocess.STARTUPINFO.copy winreg.HKEYType.handle _ctypes.FreeLibrary _ctypes.LoadLibrary