mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
This commit is contained in:
parent
5a4bbcd479
commit
a2314283ff
9 changed files with 89 additions and 38 deletions
|
|
@ -1834,7 +1834,7 @@ bytes.rpartition
|
|||
|
||||
Partition the bytes into three parts using the given separator.
|
||||
|
||||
This will search for the separator sep in the bytes, starting and the end. If
|
||||
This will search for the separator sep in the bytes, starting at the end. If
|
||||
the separator is found, returns a 3-tuple containing the part before the
|
||||
separator, the separator itself, and the part after it.
|
||||
|
||||
|
|
@ -1844,7 +1844,7 @@ objects and the original bytes object.
|
|||
|
||||
static PyObject *
|
||||
bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep)
|
||||
/*[clinic end generated code: output=191b114cbb028e50 input=67f689e63a62d478]*/
|
||||
/*[clinic end generated code: output=191b114cbb028e50 input=d78db010c8cfdbe1]*/
|
||||
{
|
||||
return stringlib_rpartition(
|
||||
(PyObject*) self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue