diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 09:58:24 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 09:58:24 +0300 |
| commit | 886a5f352fd64bcdc814dad292bbb37739a1cdd9 (patch) | |
| tree | 54492f7a1066712a3ec190204170b80a11e9d083 /Modules | |
| parent | 08bb8a41cc976343795bd0e241cd7388e9f44ad5 (diff) | |
| download | cpython-git-886a5f352fd64bcdc814dad292bbb37739a1cdd9.tar.gz | |
Issue #27343: Fixed error message for conflicting initializers of ctypes.Structure.
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/_ctypes/_ctypes.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 311fb5d645..a7a81056bc 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; |
