Skip to content

Commit 2d8ddcb

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/ctypes/wintypes.pyi

Lines changed: 5 additions & 2 deletions
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,10 @@ 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 as BYTE
29+
else:
30+
from ctypes import c_byte as BYTE
2831
WORD = c_ushort
2932
DWORD = c_ulong
3033
CHAR = c_char

0 commit comments

Comments
 (0)