diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index 8e77280791fa..8d0631cdd291 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -254,3 +254,8 @@ types.SimpleNamespace.__init__ # class doesn't accept positional arguments but h # These enums derive from (str, Enum) pstats.SortKey.__new__ tkinter.EventType.__new__ + +# Incorrectly star import. +ctypes._endian.DEFAULT_MODE +ctypes._endian.RTLD_GLOBAL +ctypes._endian.RTLD_LOCAL diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index aac0d4820b62..308855f8f00b 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -214,3 +214,8 @@ asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..* + +# Incorrectly star import. +ctypes._endian.DEFAULT_MODE +ctypes._endian.RTLD_GLOBAL +ctypes._endian.RTLD_LOCAL diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index 616fe8cf620e..5cd924397f6e 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -193,3 +193,9 @@ typing.SupportsAbs.__type_params__ typing.SupportsRound.__type_params__ typing_extensions.SupportsAbs.__type_params__ typing_extensions.SupportsRound.__type_params__ + +# Incorrectly star import. +ctypes._endian.DEFAULT_MODE +ctypes._endian.RTLD_GLOBAL +ctypes._endian.RTLD_LOCAL +ctypes._endian.SIZEOF_TIME_T diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 1a3d31b8dabb..7c2e02700d23 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -7,13 +7,6 @@ _thread.interrupt_main _thread.lock _thread.start_joinable_thread _tkinter.create -ctypes._endian.DEFAULT_MODE -ctypes._endian.RTLD_GLOBAL -ctypes._endian.RTLD_LOCAL -ctypes._endian.SIZEOF_TIME_T -ctypes._endian.cdll -ctypes._endian.pydll -ctypes._endian.pythonapi doctest.TestResults.__doc__ doctest.TestResults.__new__ filecmp.dircmp.__init__ diff --git a/stdlib/@tests/stubtest_allowlists/py38.txt b/stdlib/@tests/stubtest_allowlists/py38.txt index 893efaae4a38..7866e8c822b0 100644 --- a/stdlib/@tests/stubtest_allowlists/py38.txt +++ b/stdlib/@tests/stubtest_allowlists/py38.txt @@ -245,3 +245,8 @@ unittest\.test\..+ # These enums derive from (str, Enum) pstats.SortKey.__new__ tkinter.EventType.__new__ + +# Incorrectly star import. +ctypes._endian.DEFAULT_MODE +ctypes._endian.RTLD_GLOBAL +ctypes._endian.RTLD_LOCAL diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt index 5203888299e9..e7217a040654 100644 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ b/stdlib/@tests/stubtest_allowlists/py39.txt @@ -228,3 +228,8 @@ types.SimpleNamespace.__init__ # class doesn't accept positional arguments but # These enums derive from (str, Enum) pstats.SortKey.__new__ tkinter.EventType.__new__ + +# Incorrectly star import. +ctypes._endian.DEFAULT_MODE +ctypes._endian.RTLD_GLOBAL +ctypes._endian.RTLD_LOCAL diff --git a/stdlib/@tests/stubtest_allowlists/win32-py313.txt b/stdlib/@tests/stubtest_allowlists/win32-py313.txt index b59e0dea962d..a846e5853351 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py313.txt @@ -22,8 +22,6 @@ _winapi.STARTF_USEHOTKEY _winapi.STARTF_USEPOSITION _winapi.STARTF_USESIZE _winapi.SetEvent -ctypes._endian.oledll -ctypes._endian.windll nt.fchmod nt.lchmod ntpath.exists diff --git a/stdlib/ctypes/_endian.pyi b/stdlib/ctypes/_endian.pyi index add6365e615f..144f5ba5dd40 100644 --- a/stdlib/ctypes/_endian.pyi +++ b/stdlib/ctypes/_endian.pyi @@ -1,12 +1,5 @@ import sys -from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL, Structure, Union -from ctypes import DEFAULT_MODE as DEFAULT_MODE, cdll as cdll, pydll as pydll, pythonapi as pythonapi - -if sys.version_info >= (3, 12): - from _ctypes import SIZEOF_TIME_T as SIZEOF_TIME_T - -if sys.platform == "win32": - from ctypes import oledll as oledll, windll as windll +from ctypes import Structure, Union # At runtime, the native endianness is an alias for Structure, # while the other is a subclass with a metaclass added in.