Skip to content

Commit a83fbaa

Browse files
committed
FIX: import internal cpython headers to fix for py311
In 18b5dd68c6b616257ae243c0b6bb965ffc885a23 / python/cpython#31530 / https://bugs.python.org/issue46836 The `_frame` struct was moved to an internal header, however the public API is primarily read-only, and cython needs to build _frame objects so still import the internal headers.
1 parent 11a9e73 commit a83fbaa

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎Cython/Utility/Coroutine.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ static int __pyx_Generator_init(PyObject *module); /*proto*/
499499
//@requires: ModuleSetupCode.c::IncludeStructmemberH
500500

501501
#include <frameobject.h>
502+
#if PY_VERSION_HEX >= 0x030b00a6
503+
#include "internal/pycore_frame.h"
504+
#endif
502505

503506
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
504507

‎Cython/Utility/Exceptions.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
784784

785785
#include "compile.h"
786786
#include "frameobject.h"
787+
#if PY_VERSION_HEX >= 0x030b00a6
788+
#include "internal/pycore_frame.h"
789+
#endif
787790
#include "traceback.h"
788791

789792
#if CYTHON_COMPILING_IN_LIMITED_API

‎Cython/Utility/ObjectHandling.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,9 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
24442444
#if !CYTHON_VECTORCALL
24452445
#if PY_VERSION_HEX >= 0x03080000
24462446
#include "frameobject.h"
2447+
#if PY_VERSION_HEX >= 0x030b00a6
2448+
#include "internal/pycore_frame.h"
2449+
#endif
24472450
#define __Pxy_PyFrame_Initialize_Offsets()
24482451
#define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
24492452
#else
@@ -3106,5 +3109,3 @@ static CYTHON_INLINE void __Pyx_RaiseCppAttributeError(const char *varname); /*p
31063109
static CYTHON_INLINE void __Pyx_RaiseCppAttributeError(const char *varname) {
31073110
PyErr_Format(PyExc_AttributeError, "C++ attribute '%s' is not initialized", varname);
31083111
}
3109-
3110-

‎Cython/Utility/Profile.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
#include "compile.h"
3939
#include "frameobject.h"
40+
#if PY_VERSION_HEX >= 0x030b00a6
41+
#include "internal/pycore_frame.h"
42+
#endif
4043
#include "traceback.h"
4144

4245
#if CYTHON_PROFILE_REUSE_FRAME

0 commit comments

Comments
 (0)