From 330959bddf0c4a1918dfc475d229ca5991eebc5a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 21 Aug 2023 23:43:51 +0200 Subject: [PATCH] Don't include frameobject.h on Python 3.11 --- pythoncapi_compat.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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