From 1ad1b3f911513d973d32a3b2f090f237e9a1072b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 6 Feb 1998 22:37:12 +0000 Subject: Forgot to return NULL in joinfields() when a type error was detected in one of the sequence items. --- Modules/stropmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit v0.12