Skip to content

Commit 0fd6cd2

Browse files
authored
Resolve 3.13 issues for ctypes._endian (#12372)
1 parent 0bc7b4f commit 0fd6cd2

File tree

8 files changed

+27
-17
lines changed

8 files changed

+27
-17
lines changed

stdlib/@tests/stubtest_allowlists/py310.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,8 @@ types.SimpleNamespace.__init__ # class doesn't accept positional arguments but h
254254
# These enums derive from (str, Enum)
255255
pstats.SortKey.__new__
256256
tkinter.EventType.__new__
257+
258+
# Incorrectly star import.
259+
ctypes._endian.DEFAULT_MODE
260+
ctypes._endian.RTLD_GLOBAL
261+
ctypes._endian.RTLD_LOCAL

stdlib/@tests/stubtest_allowlists/py311.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,8 @@ asynchat.async_chat.use_encoding
214214
asynchat.find_prefix_at_end
215215
pkgutil.ImpImporter\..*
216216
pkgutil.ImpLoader\..*
217+
218+
# Incorrectly star import.
219+
ctypes._endian.DEFAULT_MODE
220+
ctypes._endian.RTLD_GLOBAL
221+
ctypes._endian.RTLD_LOCAL

stdlib/@tests/stubtest_allowlists/py312.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,9 @@ typing.SupportsAbs.__type_params__
193193
typing.SupportsRound.__type_params__
194194
typing_extensions.SupportsAbs.__type_params__
195195
typing_extensions.SupportsRound.__type_params__
196+
197+
# Incorrectly star import.
198+
ctypes._endian.DEFAULT_MODE
199+
ctypes._endian.RTLD_GLOBAL
200+
ctypes._endian.RTLD_LOCAL
201+
ctypes._endian.SIZEOF_TIME_T

stdlib/@tests/stubtest_allowlists/py313.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ _thread.interrupt_main
77
_thread.lock
88
_thread.start_joinable_thread
99
_tkinter.create
10-
ctypes._endian.DEFAULT_MODE
11-
ctypes._endian.RTLD_GLOBAL
12-
ctypes._endian.RTLD_LOCAL
13-
ctypes._endian.SIZEOF_TIME_T
14-
ctypes._endian.cdll
15-
ctypes._endian.pydll
16-
ctypes._endian.pythonapi
1710
doctest.TestResults.__doc__
1811
doctest.TestResults.__new__
1912
filecmp.dircmp.__init__

stdlib/@tests/stubtest_allowlists/py38.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,8 @@ unittest\.test\..+
245245
# These enums derive from (str, Enum)
246246
pstats.SortKey.__new__
247247
tkinter.EventType.__new__
248+
249+
# Incorrectly star import.
250+
ctypes._endian.DEFAULT_MODE
251+
ctypes._endian.RTLD_GLOBAL
252+
ctypes._endian.RTLD_LOCAL

stdlib/@tests/stubtest_allowlists/py39.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,8 @@ types.SimpleNamespace.__init__ # class doesn't accept positional arguments but
228228
# These enums derive from (str, Enum)
229229
pstats.SortKey.__new__
230230
tkinter.EventType.__new__
231+
232+
# Incorrectly star import.
233+
ctypes._endian.DEFAULT_MODE
234+
ctypes._endian.RTLD_GLOBAL
235+
ctypes._endian.RTLD_LOCAL

stdlib/@tests/stubtest_allowlists/win32-py313.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ _winapi.STARTF_USEHOTKEY
2222
_winapi.STARTF_USEPOSITION
2323
_winapi.STARTF_USESIZE
2424
_winapi.SetEvent
25-
ctypes._endian.oledll
26-
ctypes._endian.windll
2725
nt.fchmod
2826
nt.lchmod
2927
ntpath.exists

stdlib/ctypes/_endian.pyi

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import sys
2-
from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL, Structure, Union
3-
from ctypes import DEFAULT_MODE as DEFAULT_MODE, cdll as cdll, pydll as pydll, pythonapi as pythonapi
4-
5-
if sys.version_info >= (3, 12):
6-
from _ctypes import SIZEOF_TIME_T as SIZEOF_TIME_T
7-
8-
if sys.platform == "win32":
9-
from ctypes import oledll as oledll, windll as windll
2+
from ctypes import Structure, Union
103

114
# At runtime, the native endianness is an alias for Structure,
125
# while the other is a subclass with a metaclass added in.

0 commit comments

Comments
 (0)