_type_ class attributes in ctypes, and fix ctypes.wintypes.BYTE (#13777)

This commit is contained in:
Joren Hammudoglu
2025-04-07 14:16:11 +02:00
committed by GitHub
parent 2ae5ed8b62
commit 6b8aebcc9c
2 changed files with 104 additions and 48 deletions
+10 -2
View File
@@ -1,10 +1,10 @@
import sys
from _ctypes import _CArgObject, _CField
from ctypes import (
Array,
Structure,
_Pointer,
_SimpleCData,
c_byte,
c_char,
c_char_p,
c_double,
@@ -24,7 +24,15 @@ from ctypes import (
from typing import Any, TypeVar
from typing_extensions import Self, TypeAlias
BYTE = c_byte
if sys.version_info >= (3, 12):
from ctypes import c_ubyte
BYTE = c_ubyte
else:
from ctypes import c_byte
BYTE = c_byte
WORD = c_ushort
DWORD = c_ulong
CHAR = c_char