[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:
Oren Milman 2017-10-12 17:39:01 +03:00 committed by Serhiy Storchaka
parent f15058a697
commit fb3bb8d5d5
1 changed files with 3 additions and 3 deletions

View File

@ -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;