add missing _ctypes functions (#13067)

This commit is contained in:
Stephen Morton
2024-11-22 07:07:12 -08:00
committed by GitHub
parent 1af850d2b0
commit 05b969f975
3 changed files with 7 additions and 10 deletions

View File

@@ -24,11 +24,6 @@ select.POLLMSG # system dependent
(posix.ST_[A-Z]+)?
(termios.[A-Z0-9_]+)?
# Exists at runtime, but missing from stubs
_ctypes.dlclose
_ctypes.dlopen
_ctypes.dlsym
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========

View File

@@ -5,10 +5,6 @@
curses.has_key
selectors.KqueueSelector
_ctypes.dlclose
_ctypes.dlopen
_ctypes.dlsym
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========

View File

@@ -1,6 +1,6 @@
import _typeshed
import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer
from abc import abstractmethod
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from ctypes import CDLL, ArgumentError as ArgumentError, c_void_p
@@ -48,6 +48,12 @@ if sys.platform == "win32":
def LoadLibrary(name: str, load_flags: int = 0, /) -> int: ...
def FreeLibrary(handle: int, /) -> None: ...
else:
def dlclose(handle: int, /) -> None: ...
# The default for flag is RTLD_GLOBAL|RTLD_LOCAL, which is platform dependent.
def dlopen(name: StrOrBytesPath, flag: int = ..., /) -> int: ...
def dlsym(handle: int, name: str, /) -> int: ...
if sys.version_info >= (3, 13):
# This class is not exposed. It calls itself _ctypes.CType_Type.
@type_check_only