mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Fix some endcase bugs in unicode rfind()/rindex() and endswith().
These were reported and fixed by Inyeol Lee in SF bug 595350. The endswith() bug was already fixed in 2.3, but this adds some more test cases.
This commit is contained in:
parent
c230b0e1f9
commit
76afbd9aa4
4 changed files with 11 additions and 4 deletions
|
|
@ -1536,7 +1536,7 @@ string_find_internal(PyStringObject *self, PyObject *args, int dir)
|
|||
}
|
||||
#ifdef Py_USING_UNICODE
|
||||
else if (PyUnicode_Check(subobj))
|
||||
return PyUnicode_Find((PyObject *)self, subobj, i, last, 1);
|
||||
return PyUnicode_Find((PyObject *)self, subobj, i, last, dir);
|
||||
#endif
|
||||
else if (PyObject_AsCharBuffer(subobj, &sub, &n))
|
||||
return -2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue