[Python-checkins] [2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3952)

Serhiy Storchaka webhook-mailer at python.org
Thu Oct 12 10:39:04 EDT 2017


https://github.com/python/cpython/commit/fb3bb8d5d5d70acaaa0fdec15c137544fdd4463f
commit: fb3bb8d5d5d70acaaa0fdec15c137544fdd4463f
branch: 2.7
author: Oren Milman <orenmn at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2017-10-12T17:39:01+03:00
summary:

[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3952)

files:
M Modules/_ctypes/stgdict.c

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;



More information about the Python-checkins mailing list