mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-99275: Fix SystemError
in ctypes
during __initsubclass__
(#99283)
This commit is contained in:
parent
d329f859b9
commit
343eb0f94b
3 changed files with 15 additions and 1 deletions
|
@ -424,8 +424,11 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
|
|||
}
|
||||
|
||||
stgdict = PyType_stgdict(type);
|
||||
if (!stgdict)
|
||||
if (!stgdict) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"ctypes state is not initialized");
|
||||
return -1;
|
||||
}
|
||||
/* If this structure/union is already marked final we cannot assign
|
||||
_fields_ anymore. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue