diff --git a/pandas/_libs/src/compat_helper.h b/pandas/_libs/src/compat_helper.h index e3c40d2ca65f4..8f86bb3f8e62f 100644 --- a/pandas/_libs/src/compat_helper.h +++ b/pandas/_libs/src/compat_helper.h @@ -17,8 +17,19 @@ The full license is in the LICENSE file, distributed with this software. PySlice_GetIndicesEx changes signature in PY3 but 3.6.1 in particular changes the behavior of this function slightly https://bugs.python.org/issue27867 + + +In 3.6.1 PySlice_GetIndicesEx was changed to a macro +inadvertently breaking ABI compat. For now, undefing +the macro, which restores compat. +https://github.com/pandas-dev/pandas/issues/15961 +https://bugs.python.org/issue29943 */ +#if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) + #undef PySlice_GetIndicesEx +#endif + PANDAS_INLINE int slice_get_indices(PyObject *s, Py_ssize_t length, Py_ssize_t *start,