summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-02-06 22:37:12 (GMT)
committerGuido van Rossum <guido@python.org>1998-02-06 22:37:12 (GMT)
commit1ad1b3f911513d973d32a3b2f090f237e9a1072b (patch)
tree0adb3f523a1d61c83270ea1ba75bfb5b6fd95d6d /Modules
parent64608cfb867b94b989f01be7f6b71457019ba3ef (diff)
downloadcpython-1ad1b3f911513d973d32a3b2f090f237e9a1072b.zip
cpython-1ad1b3f911513d973d32a3b2f090f237e9a1072b.tar.gz
cpython-1ad1b3f911513d973d32a3b2f090f237e9a1072b.tar.bz2
Forgot to return NULL in joinfields() when a type error was detected
in one of the sequence items.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/stropmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c
index efb6ea1..1821db8 100644
--- a/Modules/stropmodule.c
+++ b/Modules/stropmodule.c
@@ -225,9 +225,11 @@ strop_joinfields(self, args)
if (seqlen == 1) {
/* Optimization if there's only one item */
PyObject *item = PySequence_GetItem(seq, 0);
- if (item && !PyString_Check(item))
+ if (item && !PyString_Check(item)) {
PyErr_SetString(PyExc_TypeError,
"first argument must be sequence of strings");
+ return NULL;
+ }
return item;
}