Fix for bug [ 561796 ] string.find causes lazy error

This commit is contained in:
Marc-André Lemburg 2002-05-29 11:33:13 +00:00
parent 1e1542fcff
commit 4da6fd63bc
2 changed files with 4 additions and 3 deletions

View file

@ -2887,11 +2887,11 @@ int PyUnicode_Find(PyObject *str,
str = PyUnicode_FromObject(str);
if (str == NULL)
return -1;
return -2;
substr = PyUnicode_FromObject(substr);
if (substr == NULL) {
Py_DECREF(substr);
return -1;
return -2;
}
result = findstring((PyUnicodeObject *)str,