Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.

This commit is contained in:
Serhiy Storchaka 2016-06-18 09:58:55 +03:00
commit d91e676fd5
2 changed files with 5 additions and 10 deletions

View file

@ -4065,14 +4065,9 @@ _init_pos_args(PyObject *self, PyTypeObject *type,
}
val = PyTuple_GET_ITEM(args, i + index);
if (kwds && PyDict_GetItem(kwds, name)) {
char *field = PyBytes_AsString(name);
if (field == NULL) {
PyErr_Clear();
field = "???";
}
PyErr_Format(PyExc_TypeError,
"duplicate values for field '%s'",
field);
"duplicate values for field %R",
name);
Py_DECREF(pair);
Py_DECREF(name);
return -1;