Patch [ 1586791 ] better error msgs for some TypeErrors

This commit is contained in:
Georg Brandl 2006-11-19 08:48:30 +00:00
parent db4f255c61
commit 283a1353a0
5 changed files with 27 additions and 16 deletions

View file

@ -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;
}
}