]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Forgot to return NULL in joinfields() when a type error was detected
authorGuido van Rossum <guido@python.org>
Fri, 6 Feb 1998 22:37:12 +0000 (22:37 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 6 Feb 1998 22:37:12 +0000 (22:37 +0000)
in one of the sequence items.

Modules/stropmodule.c

index efb6ea1c03d1c70bf462cb9b9218fc0dae831cd2..1821db84a64f5b15eed095c15724af94937c4341 100644 (file)
@@ -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;
        }