Commit 1ad1b3f9 authored by Guido van Rossum's avatar Guido van Rossum

Forgot to return NULL in joinfields() when a type error was detected

in one of the sequence items.
parent 64608cfb
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment