summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:58:55 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:58:55 (GMT)
commitd91e676fd58a25420a3dc8705472dc6bf9ca46e2 (patch)
tree6b59a2b47e11a56fc46a26e1016d36832fb00e26 /Modules
parent5d062d7ba34068bed20e8b7486f9973bfafcd203 (diff)
parent886a5f352fd64bcdc814dad292bbb37739a1cdd9 (diff)
downloadcpython-d91e676fd58a25420a3dc8705472dc6bf9ca46e2.zip
cpython-d91e676fd58a25420a3dc8705472dc6bf9ca46e2.tar.gz
cpython-d91e676fd58a25420a3dc8705472dc6bf9ca46e2.tar.bz2
Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 44d1e56..331343b 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -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;