GeezerVison is showing github.com — No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__ · Issue #99275 · python/cpython
No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__ #99275Description
Bug report
No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__
Reproduce code:
import ctypes
class 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):
pass
Output 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 set
Your environment
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Activitysobolevn commented on Nov 9, 2022 I proposed a PR that sets the exception. added 4 commits that reference this issue on Nov 13, 2022pythongh-99275: Fix `SystemError` in `ctypes` during `__initsubclass_… pythongh-99275: Fix `SystemError` in `ctypes` during `__initsubclass_… gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (GH… gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (GH… encukou commented on Sep 18, 2024 Thanks for the fix! I'll close the issue.
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|