def check_ctypes_datatype(datatype):
valid_datatypes = (
ctypes._SimpleCData,
ctypes.Union,
ctypes.BigEndianStructure,
ctypes.LittleEndianStructure,
ctypes.Structure,
)
for t in valid_datatypes:
if issubclass(datatype, t):
return
raise TypeError('datatype must be a ctypes data type, but was {}'.format(datatype.__name__))
评论列表
文章目录