Michael Hudson <mwh21@cam.ac.uk>:

Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
This commit is contained in:
Fred Drake 2000-06-01 03:12:13 +00:00
parent 94c3452ade
commit b6a9ada757
3 changed files with 12 additions and 4 deletions

View file

@ -388,7 +388,9 @@ list_concat(a, bb)
int i;
PyListObject *np;
if (!PyList_Check(bb)) {
PyErr_BadArgument();
PyErr_Format(PyExc_TypeError,
"can only append list (not \"%.200s\") to list",
bb->ob_type->tp_name);
return NULL;
}
#define b ((PyListObject *)bb)
@ -469,7 +471,9 @@ list_ass_slice(a, ilow, ihigh, v)
}
}
else {
PyErr_BadArgument();
PyErr_Format(PyExc_TypeError,
"must assign list (not \"%.200s\") to slice",
v->ob_type->tp_name);
return -1;
}
if (ilow < 0)