mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Michael Hudson <mwh21@cam.ac.uk>:
Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
This commit is contained in:
parent
b5fc749c8b
commit
137507ea03
3 changed files with 14 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue