summaryrefslogtreecommitdiff
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-08 11:48:57 +0300
committerGitHub <noreply@github.com>2017-04-08 11:48:57 +0300
commite41390aca51e4e3eb455cf3b70f5d656a2814db9 (patch)
treee90f8b0b47ec38d5dc7871b4e5b0f944c46473a4 /Objects/structseq.c
parent7f85947106aff5b1f166a57f644f987db4d38bf0 (diff)
downloadcpython-git-e41390aca51e4e3eb455cf3b70f5d656a2814db9.tar.gz
bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)
(cherry picked from commit b879fe8)
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 75c1ffb0fa..9b3ba48a88 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -114,11 +114,11 @@ structseq_subscript(PyStructSequence *self, PyObject *item)
Py_ssize_t start, stop, step, slicelen, cur, i;
PyObject *result;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
- VISIBLE_SIZE(self), &start, &stop,
- &step, &slicelen) < 0) {
+ if (_PySlice_Unpack((PySliceObject *)item, &start, &stop, &step) < 0) {
return NULL;
}
+ slicelen = _PySlice_AdjustIndices(VISIBLE_SIZE(self), &start, &stop,
+ step);
if (slicelen <= 0)
return PyTuple_New(0);
result = PyTuple_New(slicelen);