summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.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/posixmodule.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/posixmodule.c')
-rw-r--r--Modules/posixmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 1ca3826..20efb0e 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1562,8 +1562,7 @@ posix_spawnv(self, args)
getitem = PyTuple_GetItem;
}
else {
- badarg:
- PyErr_BadArgument();
+ PyErr_SetString(PyExc_TypeError, "argv must be tuple or list");
return NULL;
}
@@ -1573,7 +1572,9 @@ posix_spawnv(self, args)
for (i = 0; i < argc; i++) {
if (!PyArg_Parse((*getitem)(argv, i), "s", &argvlist[i])) {
PyMem_DEL(argvlist);
- goto badarg;
+ PyErr_SetString(PyExc_TypeError,
+ "all arguments must be strings");
+ return NULL;
}
}
argvlist[argc] = NULL;