mirror of
https://github.com/python/cpython.git
synced 2026-01-29 02:32:18 +00:00
Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument. Backport of r66119
This commit is contained in:
parent
50b1c4920b
commit
afa0d58a2d
3 changed files with 9 additions and 1 deletions
|
|
@ -1595,7 +1595,7 @@ string_rpartition(PyStringObject *self, PyObject *sep_obj)
|
|||
}
|
||||
#ifdef Py_USING_UNICODE
|
||||
else if (PyUnicode_Check(sep_obj))
|
||||
return PyUnicode_Partition((PyObject *) self, sep_obj);
|
||||
return PyUnicode_RPartition((PyObject *) self, sep_obj);
|
||||
#endif
|
||||
else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue