Skip to content

Commit f43b293

Browse files
[3.6] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (GH-1049) (#1813)
if Py_LIMITED_API is not defined. (cherry picked from commit 49a9059)
1 parent 89a3102 commit f43b293

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Include/sliceobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
4545
Py_ssize_t *step, Py_ssize_t *slicelength);
4646

4747
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
48+
#ifdef Py_LIMITED_API
4849
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
4950
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
5051
((*(slicelen) = 0), -1) : \
5152
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
5253
0))
54+
#endif
5355
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
5456
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
5557
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,

Misc/NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ Library
153153
exception) to exception(s) raised in the dispatched methods.
154154
Patch by Petr Motejlek.
155155

156+
C API
157+
-----
158+
159+
- Issue #27867: Function PySlice_GetIndicesEx() no longer replaced with a macro
160+
if Py_LIMITED_API is not set.
161+
162+
156163
Build
157164
-----
158165

0 commit comments

Comments
 (0)