mirror of
https://github.com/python/cpython
synced 2026-09-29 09:55:31 +03:00
Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.
This commit is contained in:
commit
d91e676fd5
2 changed files with 5 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue