[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3952)
This commit is contained in:
parent
f15058a697
commit
fb3bb8d5d5
|
@ -288,9 +288,9 @@ MakeAnonFields(PyObject *type)
|
|||
}
|
||||
if (Py_TYPE(descr) != &PyCField_Type) {
|
||||
PyErr_Format(PyExc_AttributeError,
|
||||
"'%U' is specified in _anonymous_ but not in "
|
||||
"_fields_",
|
||||
fname);
|
||||
"an item in _anonymous_ (index %zd) is not "
|
||||
"specified in _fields_",
|
||||
i);
|
||||
Py_DECREF(anon_names);
|
||||
Py_DECREF(descr);
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue