summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-08 06:53:51 (GMT)
committerGitHub <noreply@github.com>2017-04-08 06:53:51 (GMT)
commitb879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 (patch)
tree714c168e58166c2acb07b737ce3ca02db71fe2af /Objects/unicodeobject.c
parent205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 (diff)
downloadcpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.zip
cpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.gz
cpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.bz2
Expand the PySlice_GetIndicesEx macro. (#1023)
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index b414571..ef2215f 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13996,10 +13996,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();