mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Expand the PySlice_GetIndicesEx macro. (#1023)
This commit is contained in:
parent
205e00c5cf
commit
b879fe82e7
11 changed files with 47 additions and 45 deletions
|
@ -2285,10 +2285,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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue