summaryrefslogtreecommitdiffstats
path: root/Objects/memoryobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-08 08:18:30 (GMT)
committerGitHub <noreply@github.com>2017-04-08 08:18:30 (GMT)
commitfa25f16a4499178d7d79c18d2d68be7f70594106 (patch)
tree24842baa21432bc34b05601ed760266361ed267f /Objects/memoryobject.c
parentae0915e42d8cd96e5ced1fc442ea078b4a59e82d (diff)
downloadcpython-fa25f16a4499178d7d79c18d2d68be7f70594106.zip
cpython-fa25f16a4499178d7d79c18d2d68be7f70594106.tar.gz
cpython-fa25f16a4499178d7d79c18d2d68be7f70594106.tar.bz2
Expand the PySlice_GetIndicesEx macro. (#1023) (#1045)
(cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r--Objects/memoryobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index e261ee0..45849be 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -2311,10 +2311,10 @@ init_slice(Py_buffer *base, PyObject *key, int dim)
{
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx(key, base->shape[dim],
- &start, &stop, &step, &slicelength) < 0) {
+ if (PySlice_Unpack(key, &start, &stop, &step) < 0) {
return -1;
}
+ slicelength = PySlice_AdjustIndices(base->shape[dim], &start, &stop, step);
if (base->suboffsets == NULL || dim == 0) {