mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
add missing _ctypes functions (#13067)
This commit is contained in:
@@ -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
|
||||
# ==========
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
curses.has_key
|
||||
selectors.KqueueSelector
|
||||
|
||||
_ctypes.dlclose
|
||||
_ctypes.dlopen
|
||||
_ctypes.dlsym
|
||||
|
||||
# ==========
|
||||
# Allowlist entries that cannot or should not be fixed
|
||||
# ==========
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user