Skip to content

Commit ff1eadf

Browse files
committed
fix incorrect ctypes.wintypes.BYTE specification
1 parent 2700778 commit ff1eadf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

stdlib/ctypes/wintypes.pyi

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import sys
12
from _ctypes import _CArgObject, _CField
23
from ctypes import (
34
Array,
45
Structure,
56
_Pointer,
67
_SimpleCData,
7-
c_byte,
88
c_char,
99
c_char_p,
1010
c_double,
@@ -24,7 +24,15 @@ from ctypes import (
2424
from typing import Any, TypeVar
2525
from typing_extensions import Self, TypeAlias
2626

27-
BYTE = c_byte
27+
if sys.version_info >= (3, 12):
28+
from ctypes import c_ubyte
29+
30+
BYTE = c_ubyte
31+
else:
32+
from ctypes import c_byte
33+
34+
BYTE = c_byte
35+
2836
WORD = c_ushort
2937
DWORD = c_ulong
3038
CHAR = c_char

0 commit comments

Comments
 (0)