diff --git a/pandas/_libs/src/compat_helper.h b/pandas/_libs/src/compat_helper.h index 8f86bb3f8e62f..bdff61d7d4150 100644 --- a/pandas/_libs/src/compat_helper.h +++ b/pandas/_libs/src/compat_helper.h @@ -26,8 +26,10 @@ the macro, which restores compat. https://bugs.python.org/issue29943 */ -#if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) - #undef PySlice_GetIndicesEx +#ifndef PYPY_VERSION +# if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) +# undef PySlice_GetIndicesEx +# endif #endif PANDAS_INLINE int slice_get_indices(PyObject *s,