Skip to content

Commit

Permalink
Add additional includes for Python 3.13 (#17506)
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
cdce8p committed Jul 7, 2024
1 parent 966d6d3 commit 4e3346e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mypyc/lib-rt/pythonsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
#include <assert.h>
#include "mypyc_util.h"

#if CPY_3_13_FEATURES
#ifndef Py_BUILD_CORE
#define Py_BUILD_CORE
#endif
#include "internal/pycore_bytesobject.h" // _PyBytes_Join
#include "internal/pycore_call.h" // _PyObject_CallMethodIdNoArgs, _PyObject_CallMethodIdObjArgs, _PyObject_CallMethodIdOneArg
#include "internal/pycore_genobject.h" // _PyGen_FetchStopIterationValue
#include "internal/pycore_object.h" // _PyType_CalculateMetaclass
#include "internal/pycore_pyerrors.h" // _PyErr_FormatFromCause, _PyErr_SetKeyError
#include "internal/pycore_unicodeobject.h" // _PyUnicode_EQ, _PyUnicode_FastCopyCharacters
#endif

#if CPY_3_12_FEATURES
#include "internal/pycore_frame.h"
#endif
Expand Down

0 comments on commit 4e3346e

Please sign in to comment.