diff --git a/pythoncapi_compat.h b/pythoncapi_compat.h index 2e9153f..7586485 100644 --- a/pythoncapi_compat.h +++ b/pythoncapi_compat.h @@ -19,7 +19,11 @@ extern "C" { #endif #include -#include "frameobject.h" // PyFrameObject, PyFrame_GetBack() + +// Python 3.11.0b4 added PyFrame_Back() to Python.h +#if PY_VERSION_HEX < 0x030b00B4 && !defined(PYPY_VERSION) +# include "frameobject.h" // PyFrameObject, PyFrame_GetBack() +#endif #ifndef _Py_CAST