Fix Windows-specific allowlist entries in _msi, msilib, selectors and subprocess (#10822)

This commit is contained in:
Alex Waygood
2023-10-02 12:01:47 +01:00
committed by GitHub
parent 07e611d41f
commit 54d825af59
5 changed files with 10 additions and 11 deletions

View File

@@ -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: ...

View File

@@ -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]

View File

@@ -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]: ...
# Not a real class at runtime, it is just a conditional alias to other real selectors.
# The runtime logic is more fine-grained than a `sys.platform` check;

View File

@@ -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,

View File

@@ -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 <class DupHandle>
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