From fb3bb8d5d5d70acaaa0fdec15c137544fdd4463f Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Thu, 12 Oct 2017 17:39:01 +0300 Subject: [PATCH] [2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3952) --- Modules/_ctypes/stgdict.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index 42182431017..d1be3ca93e5 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -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;