]> granicus.if.org Git - python/commitdiff
[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is...
authorOren Milman <orenmn@gmail.com>
Thu, 12 Oct 2017 14:39:01 +0000 (17:39 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 12 Oct 2017 14:39:01 +0000 (17:39 +0300)
Modules/_ctypes/stgdict.c

index 42182431017afab710698e77d13f80d0c648992a..d1be3ca93e570e9a38339eb737012d37b09ccd9b 100644 (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;