Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,10 @@ Porting to Python 3.10
been included directly, consider including ``Python.h`` instead.
(Contributed by Nicholas Sim in :issue:`35134`)

* The non-limited API file ``pyarena.h`` has been moved to the
``Include/internal/pycore_arena.h``.
(Contributed by Hai Shi in :issue:`43244`.)

Deprecated
----------

Expand Down
1 change: 1 addition & 0 deletions Include/Python-ast.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Include/Python.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@
#include "pystate.h"
#include "context.h"

#include "cpython/pyarena.h"
#include "modsupport.h"
#include "compile.h"
#include "pythonrun.h"
Expand Down
2 changes: 2 additions & 0 deletions Include/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
extern "C" {
#endif

#include "internal/pycore_arena.h" // struct PyArena

/* Public interface */
#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,6 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/objimpl.h \
$(srcdir)/Include/cpython/odictobject.h \
$(srcdir)/Include/cpython/picklebufobject.h \
$(srcdir)/Include/cpython/pyarena.h \
$(srcdir)/Include/cpython/pyctype.h \
$(srcdir)/Include/cpython/pydebug.h \
$(srcdir)/Include/cpython/pyerrors.h \
Expand All @@ -1129,6 +1128,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/tupleobject.h \
$(srcdir)/Include/cpython/unicodeobject.h \
\
$(srcdir)/Include/internal/pycore_arena.h \
$(srcdir)/Include/internal/pycore_abstract.h \
$(srcdir)/Include/internal/pycore_accu.h \
$(srcdir)/Include/internal/pycore_atomic.h \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The non-limited API file ``pyarena.h`` has been moved to the
``Include/internal/pycore_arena.h``.
2 changes: 1 addition & 1 deletion PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
<ClInclude Include="..\Include\cpython\odictobject.h" />
<ClInclude Include="..\Include\cpython\parser_interface.h" />
<ClInclude Include="..\Include\cpython\picklebufobject.h" />
<ClInclude Include="..\Include\cpython\pyarena.h" />
<ClInclude Include="..\Include\cpython\pyctype.h" />
<ClInclude Include="..\Include\cpython\pydebug.h" />
<ClInclude Include="..\Include\cpython\pyerrors.h" />
Expand Down Expand Up @@ -173,6 +172,7 @@
<ClInclude Include="..\Include\funcobject.h" />
<ClInclude Include="..\Include\genobject.h" />
<ClInclude Include="..\Include\import.h" />
<ClInclude Include="..\Include\internal\pycore_arena.h" />
<ClInclude Include="..\Include\internal\pycore_abstract.h" />
<ClInclude Include="..\Include\internal\pycore_accu.h" />
<ClInclude Include="..\Include\internal\pycore_atomic.h" />
Expand Down
6 changes: 3 additions & 3 deletions PCbuild/pythoncore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,6 @@
<ClInclude Include="..\Include\cpython\picklebufobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pyarena.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pyctype.h">
<Filter>Include</Filter>
</ClInclude>
Expand Down Expand Up @@ -477,6 +474,9 @@
<ClInclude Include="..\Include\cpython\initconfig.h">
<Filter>Include\cpython</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_arena.h">
<Filter>Include\internal</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_warnings.h">
<Filter>Include\internal</Filter>
</ClInclude>
Expand Down
3 changes: 3 additions & 0 deletions Parser/asdl_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,7 @@ def write_header(mod, f):
f.write('\n')
f.write('#ifndef Py_LIMITED_API\n')
f.write('#include "asdl.h"\n')
f.write('#include "pycore_arena.h"\n')
f.write('\n')
f.write('#undef Yield /* undefine macro conflicting with <winbase.h> */\n')
f.write('\n')
Expand Down Expand Up @@ -1549,6 +1550,8 @@ def write_source(mod, f, internal_h_file):
#include <stddef.h>

#include "Python.h"

#include "pycore_arena.h"
"""), file=f)

generate_module_def(mod, f, internal_h_file)
Expand Down
2 changes: 2 additions & 0 deletions Python/Python-ast.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <ctype.h>
#include "ast.h"
#undef Yield /* undefine macro conflicting with <winbase.h> */
#include "pycore_arena.h" // struct PyArena
#include "pycore_object.h" // _Py_AddToAllObjects()
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
#include "pycore_pystate.h" // _PyThreadState_GET()
Expand Down
1 change: 1 addition & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include "Python.h"
#include "pycore_arena.h" // struct PyArena
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
#include "pycore_long.h" // _PyLong_GetZero()

Expand Down
1 change: 1 addition & 0 deletions Python/pythonrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Python-ast.h"
#undef Yield /* undefine macro conflicting with <winbase.h> */

#include "pycore_arena.h" // struct PyArena
#include "pycore_interp.h" // PyInterpreterState.importlib
#include "pycore_object.h" // _PyDebug_PrintTotalRefs()
#include "pycore_pyerrors.h" // _PyErr_Fetch
Expand Down
1 change: 1 addition & 0 deletions Tools/peg_generator/peg_extension/peg_extension.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "pegen.h"
#include "pycore_arena.h" //struct PyArena

PyObject *
_build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *arena)
Expand Down