mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Patch [ 1586791 ] better error msgs for some TypeErrors
This commit is contained in:
parent
db4f255c61
commit
283a1353a0
5 changed files with 27 additions and 16 deletions
|
@ -620,8 +620,9 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
|
|||
}
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"tuple indices must be integers");
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"tuple indices must be integers, not %.200s",
|
||||
item->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue