Skip to content

Commit e4539d0

Browse files
authored
Don't include frameobject.h on Python 3.11 (#69)
1 parent a01e63e commit e4539d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pythoncapi_compat.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ extern "C" {
1919
#endif
2020

2121
#include <Python.h>
22-
#include "frameobject.h" // PyFrameObject, PyFrame_GetBack()
22+
23+
// Python 3.11.0b4 added PyFrame_Back() to Python.h
24+
#if PY_VERSION_HEX < 0x030b00B4 && !defined(PYPY_VERSION)
25+
# include "frameobject.h" // PyFrameObject, PyFrame_GetBack()
26+
#endif
2327

2428

2529
#ifndef _Py_CAST

0 commit comments

Comments
 (0)