Skip to content

Commit aea1c91

Browse files
committed
fix incorrect ctypes.wintypes.BYTE specification
1 parent f45a2c1 commit aea1c91

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/ctypes/wintypes.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from _ctypes import _CArgObject, _CField
23
from ctypes import (
34
Array,
@@ -13,6 +14,7 @@ from ctypes import (
1314
c_long,
1415
c_longlong,
1516
c_short,
17+
c_ubyte,
1618
c_uint,
1719
c_ulong,
1820
c_ulonglong,
@@ -24,7 +26,10 @@ from ctypes import (
2426
from typing import Any, TypeVar
2527
from typing_extensions import Self, TypeAlias
2628

27-
BYTE = c_byte
29+
if sys.version_info >= (3, 12):
30+
BYTE = c_ubyte
31+
else:
32+
BYTE = c_byte
2833
WORD = c_ushort
2934
DWORD = c_ulong
3035
CHAR = c_char

0 commit comments

Comments
 (0)