Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49a9059

Browse files
[3.5] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (python#1049)
if Py_LIMITED_API is not defined.
1 parent 4f43f87 commit 49a9059

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ C API
160160
-----
161161

162162
- Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
163-
Py_LIMITED_API is not set or set to the value between 0x03050400
164-
and 0x03060000 (not including) or 0x03060100 or higher.
163+
Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not
164+
including) or 0x03060100 or higher.
165165

166166
- Issue #29083: Fixed the declaration of some public API functions.
167167
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in

0 commit comments

Comments
 (0)