Index: stropmodule.c =================================================================== RCS file: /projects/cvsroot/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.44 retrieving revision 2.46 diff -c -r2.44 -r2.46 *** old/Modules/stropmodule.c 1997/12/30 05:44:10 2.44 --- Modules/stropmodule.c 1998/03/24 04:19:22 2.46 *************** *** 225,233 **** if (seqlen == 1) { /* Optimization if there's only one item */ PyObject *item = PySequence_GetItem(seq, 0); ! if (item && !PyString_Check(item)) PyErr_SetString(PyExc_TypeError, "first argument must be sequence of strings"); return item; } --- 225,235 ---- if (seqlen == 1) { /* Optimization if there's only one item */ PyObject *item = PySequence_GetItem(seq, 0); ! if (item && !PyString_Check(item)) { PyErr_SetString(PyExc_TypeError, "first argument must be sequence of strings"); + return NULL; + } return item; } *************** *** 347,353 **** if (i < 0) i = 0; ! if (n == 0) return PyInt_FromLong((long)i); last -= n; --- 349,355 ---- if (i < 0) i = 0; ! if (n == 0 && i <= last) return PyInt_FromLong((long)i); last -= n; *************** *** 392,398 **** if (i < 0) i = 0; ! if (n == 0) return PyInt_FromLong((long)last); for (j = last-n; j >= i; --j) --- 394,400 ---- if (i < 0) i = 0; ! if (n == 0 && i <= last) return PyInt_FromLong((long)last); for (j = last-n; j >= i; --j)