]> granicus.if.org Git - python/commitdiff
[3.6] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro...
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 25 May 2017 12:32:08 +0000 (15:32 +0300)
committerGitHub <noreply@github.com>
Thu, 25 May 2017 12:32:08 +0000 (15:32 +0300)
if Py_LIMITED_API is not defined.
(cherry picked from commit 49a9059)

Include/sliceobject.h
Misc/NEWS

index 36263544607096986b56c27043ef65f4e9b7bda4..579ac073d0f24131b1b4a010752876bf8477242f 100644 (file)
@@ -45,11 +45,13 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
                                      Py_ssize_t *step, Py_ssize_t *slicelength);
 
 #if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
+#ifdef Py_LIMITED_API
 #define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) (  \
     PySlice_Unpack((slice), (start), (stop), (step)) < 0 ?                  \
     ((*(slicelen) = 0), -1) :                                               \
     ((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
      0))
+#endif
 PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
                                Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
 PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
index 09eb4a76df032f3e86bed032f08e03fbef26e372..58a2ee0c3e53a744ee9a26a855531e16b5802afb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -153,6 +153,13 @@ Library
   exception) to exception(s) raised in the dispatched methods.
   Patch by Petr Motejlek.
 
+C API
+-----
+
+- Issue #27867: Function PySlice_GetIndicesEx() no longer replaced with a macro
+  if Py_LIMITED_API is not set.
+
+
 Build
 -----