summaryrefslogtreecommitdiffstats
path: root/Modules/structmodule.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-06-01 02:02:46 (GMT)
committerFred Drake <fdrake@acm.org>2000-06-01 02:02:46 (GMT)
commit137507ea0308fcdab66c1eee700048c41ed7a7d7 (patch)
treed0be03f809710a00ebfe02b7d332531fda764c99 /Modules/structmodule.c
parentb5fc749c8b809f8ebab74cebff4153880236ca33 (diff)
downloadcpython-137507ea0308fcdab66c1eee700048c41ed7a7d7.zip
cpython-137507ea0308fcdab66c1eee700048c41ed7a7d7.tar.gz
cpython-137507ea0308fcdab66c1eee700048c41ed7a7d7.tar.bz2
Michael Hudson <mwh21@cam.ac.uk>:
Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
Diffstat (limited to 'Modules/structmodule.c')
-rw-r--r--Modules/structmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index 0a706a9..d872e31 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -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);