Skip to content

Commit 4e3346e

Browse files
authored
Add additional includes for Python 3.13 (#17506)
Define `Py_BUILD_CORE` required by `internal/...` header files. Include additional headers for moved private functions. ```cpp /opt/hostedtoolcache/Python/3.13.0-beta.3/x64/include/python3.13/internal/pycore_frame.h:8:4: error: #error "this header requires Py_BUILD_CORE define" (diff) 8 | # error "this header requires Py_BUILD_CORE define" (diff) ```
1 parent 966d6d3 commit 4e3346e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mypyc/lib-rt/pythonsupport.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
#include <assert.h>
1414
#include "mypyc_util.h"
1515

16+
#if CPY_3_13_FEATURES
17+
#ifndef Py_BUILD_CORE
18+
#define Py_BUILD_CORE
19+
#endif
20+
#include "internal/pycore_bytesobject.h" // _PyBytes_Join
21+
#include "internal/pycore_call.h" // _PyObject_CallMethodIdNoArgs, _PyObject_CallMethodIdObjArgs, _PyObject_CallMethodIdOneArg
22+
#include "internal/pycore_genobject.h" // _PyGen_FetchStopIterationValue
23+
#include "internal/pycore_object.h" // _PyType_CalculateMetaclass
24+
#include "internal/pycore_pyerrors.h" // _PyErr_FormatFromCause, _PyErr_SetKeyError
25+
#include "internal/pycore_unicodeobject.h" // _PyUnicode_EQ, _PyUnicode_FastCopyCharacters
26+
#endif
27+
1628
#if CPY_3_12_FEATURES
1729
#include "internal/pycore_frame.h"
1830
#endif

0 commit comments

Comments
 (0)