summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.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/tupleobject.c
parent205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 (diff)
downloadcpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.zip
cpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.gz
cpython-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.bz2
Expand the PySlice_GetIndicesEx macro. (#1023)
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 55da0e3..2a90490 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -758,11 +758,11 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
PyObject* it;
PyObject **src, **dest;
- if (PySlice_GetIndicesEx(item,
- PyTuple_GET_SIZE(self),
- &start, &stop, &step, &slicelength) < 0) {
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
return NULL;
}
+ slicelength = PySlice_AdjustIndices(PyTuple_GET_SIZE(self), &start,
+ &stop, step);
if (slicelength <= 0) {
return PyTuple_New(0);