mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
(cherry picked from commit b879fe82e7
)
This commit is contained in:
parent
ae0915e42d
commit
fa25f16a44
11 changed files with 47 additions and 45 deletions
|
@ -13804,10 +13804,11 @@ unicode_subscript(PyObject* self, PyObject* item)
|
|||
int src_kind, dest_kind;
|
||||
Py_UCS4 ch, max_char, kind_limit;
|
||||
|
||||
if (PySlice_GetIndicesEx(item, PyUnicode_GET_LENGTH(self),
|
||||
&start, &stop, &step, &slicelength) < 0) {
|
||||
if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
slicelength = PySlice_AdjustIndices(PyUnicode_GET_LENGTH(self),
|
||||
&start, &stop, step);
|
||||
|
||||
if (slicelength <= 0) {
|
||||
_Py_RETURN_UNICODE_EMPTY();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue