Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
No exception set but raise SystemError when setting_fields_ of ctypes.Structure in__init_subclass__
Reproduce code:
import ctypesclass ParentStructure(ctypes.Structure): def __init_subclass__(cls, **kwargs): cls._fields_ =[('v1',ctypes.c_uint),('v2',ctypes.c_uint),] super().__init_subclass__(**kwargs)class ChildStructure(ParentStructure): passOutput Exception
Traceback (most recent call last): File "D:\Projects\pythonProject\main.py", line 10, in <module> class ChildStructure(ParentStructure): File "D:\Projects\pythonProject\main.py", line 6, in __init_subclass__ cls._fields_ =[('v1',ctypes.c_uint),('v2',ctypes.c_uint),]SystemError: error return without exception setYour environment
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32