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 02:02:46 +00:00
parent b5fc749c8b
commit 137507ea03
3 changed files with 14 additions and 7 deletions

View file

@ -1128,7 +1128,8 @@ struct_pack(self, args)
if (args == NULL || !PyTuple_Check(args) ||
(n = PyTuple_Size(args)) < 1)
{
PyErr_BadArgument();
PyErr_SetString(PyExc_TypeError,
"struct.pack requires at least one argument");
return NULL;
}
format = PyTuple_GetItem(args, 0);