From 7ab6620c0f37e07486a2944460f477336c925618 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sat, 23 Nov 2024 05:11:17 -0800 Subject: [PATCH] fix argument for ctypes.string_at and ctypes.wstring_at (#13075) --- stdlib/@tests/stubtest_allowlists/common.txt | 2 -- stdlib/ctypes/__init__.pyi | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 71db93042..bb1337d9e 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -23,8 +23,6 @@ copy.PyStringMap # defined only in Jython ctypes.CDLL._FuncPtr # None at class level but initialized in __init__ to this value ctypes.memmove # CFunctionType ctypes.memset # CFunctionType -ctypes.string_at # docstring argument name is wrong -ctypes.wstring_at # docstring argument name is wrong fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 functools.cached_property.__set__ # Stub is a white lie; see comments in the stub diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index 8e4505110..36ad425b7 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -130,12 +130,12 @@ if sys.platform == "win32": def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> int: ... def memset(dst: _CVoidPLike, c: int, count: int) -> int: ... -def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ... +def string_at(ptr: _CVoidConstPLike, size: int = -1) -> bytes: ... if sys.platform == "win32": def WinError(code: int | None = None, descr: str | None = None) -> OSError: ... -def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ... +def wstring_at(ptr: _CVoidConstPLike, size: int = -1) -> str: ... class c_byte(_SimpleCData[int]): ...