bpo-35134: Move non-limited C API files to Include/cpython/ (GH-24561)

Include/{odictobject.h,parser_interface.h,picklebufobject.h,pydebug.h,pyfpe.h}
into Include/cpython/.

Parser: peg_api: include Python.h instead of parser_interface.h.
This commit is contained in:
Nicholas Sim 2021-02-19 22:55:46 +08:00 committed by GitHub
parent 839184f85c
commit 4a6bf276ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 34 deletions

View File

@ -934,6 +934,14 @@ Porting to Python 3.10
bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test. bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test.
(Contributed by Zackery Spytz and Victor Stinner in :issue:`30459`.) (Contributed by Zackery Spytz and Victor Stinner in :issue:`30459`.)
* The non-limited API files ``odictobject.h``, ``parser_interface.h``,
``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``,
``pyfpe.h``, and ``pytime.h`` have been moved to the ``Include/cpython``
directory. These files must not be included directly, as they are already
included in ``Python.h``: :ref:`Include Files <api-includes>`. If they have
been included directly, consider including ``Python.h`` instead.
(Contributed by Nicholas Sim in :issue:`35134`)
Deprecated Deprecated
---------- ----------

View File

@ -89,7 +89,7 @@
#include "typeslots.h" #include "typeslots.h"
#include "pyhash.h" #include "pyhash.h"
#include "pydebug.h" #include "cpython/pydebug.h"
#include "bytearrayobject.h" #include "bytearrayobject.h"
#include "bytesobject.h" #include "bytesobject.h"
@ -104,7 +104,7 @@
#include "tupleobject.h" #include "tupleobject.h"
#include "listobject.h" #include "listobject.h"
#include "dictobject.h" #include "dictobject.h"
#include "odictobject.h" #include "cpython/odictobject.h"
#include "enumobject.h" #include "enumobject.h"
#include "setobject.h" #include "setobject.h"
#include "methodobject.h" #include "methodobject.h"
@ -126,7 +126,7 @@
#include "weakrefobject.h" #include "weakrefobject.h"
#include "structseq.h" #include "structseq.h"
#include "namespaceobject.h" #include "namespaceobject.h"
#include "picklebufobject.h" #include "cpython/picklebufobject.h"
#include "cpython/pytime.h" #include "cpython/pytime.h"
#include "codecs.h" #include "codecs.h"
@ -141,7 +141,7 @@
#include "modsupport.h" #include "modsupport.h"
#include "compile.h" #include "compile.h"
#include "pythonrun.h" #include "pythonrun.h"
#include "parser_interface.h" #include "cpython/parser_interface.h"
#include "pylifecycle.h" #include "pylifecycle.h"
#include "ceval.h" #include "ceval.h"
#include "sysmodule.h" #include "sysmodule.h"
@ -158,7 +158,7 @@
#include "pystrtod.h" #include "pystrtod.h"
#include "pystrcmp.h" #include "pystrcmp.h"
#include "fileutils.h" #include "fileutils.h"
#include "pyfpe.h" #include "cpython/pyfpe.h"
#include "tracemalloc.h" #include "tracemalloc.h"
#endif /* !Py_PYTHON_H */ #endif /* !Py_PYTHON_H */

View File

@ -316,7 +316,7 @@ PEGEN_OBJS= \
PEGEN_HEADERS= \ PEGEN_HEADERS= \
$(srcdir)/Include/parser_interface.h \ $(srcdir)/Include/cpython/parser_interface.h \
$(srcdir)/Parser/pegen.h \ $(srcdir)/Parser/pegen.h \
$(srcdir)/Parser/string_parser.h $(srcdir)/Parser/string_parser.h
@ -1056,17 +1056,13 @@ PYTHON_HEADERS= \
$(srcdir)/Include/namespaceobject.h \ $(srcdir)/Include/namespaceobject.h \
$(srcdir)/Include/object.h \ $(srcdir)/Include/object.h \
$(srcdir)/Include/objimpl.h \ $(srcdir)/Include/objimpl.h \
$(srcdir)/Include/odictobject.h \
$(srcdir)/Include/opcode.h \ $(srcdir)/Include/opcode.h \
$(srcdir)/Include/osdefs.h \ $(srcdir)/Include/osdefs.h \
$(srcdir)/Include/osmodule.h \ $(srcdir)/Include/osmodule.h \
$(srcdir)/Include/patchlevel.h \ $(srcdir)/Include/patchlevel.h \
$(srcdir)/Include/picklebufobject.h \
$(srcdir)/Include/pycapsule.h \ $(srcdir)/Include/pycapsule.h \
$(srcdir)/Include/pydebug.h \
$(srcdir)/Include/pydtrace.h \ $(srcdir)/Include/pydtrace.h \
$(srcdir)/Include/pyerrors.h \ $(srcdir)/Include/pyerrors.h \
$(srcdir)/Include/pyfpe.h \
$(srcdir)/Include/pyframe.h \ $(srcdir)/Include/pyframe.h \
$(srcdir)/Include/pyhash.h \ $(srcdir)/Include/pyhash.h \
$(srcdir)/Include/pylifecycle.h \ $(srcdir)/Include/pylifecycle.h \
@ -1116,9 +1112,13 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/methodobject.h \ $(srcdir)/Include/cpython/methodobject.h \
$(srcdir)/Include/cpython/object.h \ $(srcdir)/Include/cpython/object.h \
$(srcdir)/Include/cpython/objimpl.h \ $(srcdir)/Include/cpython/objimpl.h \
$(srcdir)/Include/cpython/odictobject.h \
$(srcdir)/Include/cpython/picklebufobject.h \
$(srcdir)/Include/cpython/pyarena.h \ $(srcdir)/Include/cpython/pyarena.h \
$(srcdir)/Include/cpython/pyctype.h \ $(srcdir)/Include/cpython/pyctype.h \
$(srcdir)/Include/cpython/pydebug.h \
$(srcdir)/Include/cpython/pyerrors.h \ $(srcdir)/Include/cpython/pyerrors.h \
$(srcdir)/Include/cpython/pyfpe.h \
$(srcdir)/Include/cpython/pylifecycle.h \ $(srcdir)/Include/cpython/pylifecycle.h \
$(srcdir)/Include/cpython/pymem.h \ $(srcdir)/Include/cpython/pymem.h \
$(srcdir)/Include/cpython/pystate.h \ $(srcdir)/Include/cpython/pystate.h \

View File

@ -0,0 +1,3 @@
Move odictobject.h, parser_interface.h, picklebufobject.h, pydebug.h, and
pyfpe.h into the cpython/ directory. They must not be included directly, as
they are already included by Python.h: :ref:`Include Files <api-includes>`.

View File

@ -142,9 +142,14 @@
<ClInclude Include="..\Include\cpython\methodobject.h" /> <ClInclude Include="..\Include\cpython\methodobject.h" />
<ClInclude Include="..\Include\cpython\object.h" /> <ClInclude Include="..\Include\cpython\object.h" />
<ClInclude Include="..\Include\cpython\objimpl.h" /> <ClInclude Include="..\Include\cpython\objimpl.h" />
<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\pyarena.h" />
<ClInclude Include="..\Include\cpython\pyctype.h" /> <ClInclude Include="..\Include\cpython\pyctype.h" />
<ClInclude Include="..\Include\cpython\pydebug.h" />
<ClInclude Include="..\Include\cpython\pyerrors.h" /> <ClInclude Include="..\Include\cpython\pyerrors.h" />
<ClInclude Include="..\Include\cpython\pyfpe.h" />
<ClInclude Include="..\Include\cpython\pylifecycle.h" /> <ClInclude Include="..\Include\cpython\pylifecycle.h" />
<ClInclude Include="..\Include\cpython\pymem.h" /> <ClInclude Include="..\Include\cpython\pymem.h" />
<ClInclude Include="..\Include\cpython\pystate.h" /> <ClInclude Include="..\Include\cpython\pystate.h" />
@ -220,19 +225,14 @@
<ClInclude Include="..\Include\namespaceobject.h" /> <ClInclude Include="..\Include\namespaceobject.h" />
<ClInclude Include="..\Include\object.h" /> <ClInclude Include="..\Include\object.h" />
<ClInclude Include="..\Include\objimpl.h" /> <ClInclude Include="..\Include\objimpl.h" />
<ClInclude Include="..\Include\odictobject.h" />
<ClInclude Include="..\Include\opcode.h" /> <ClInclude Include="..\Include\opcode.h" />
<ClInclude Include="..\Include\osdefs.h" /> <ClInclude Include="..\Include\osdefs.h" />
<ClInclude Include="..\Include\osmodule.h" /> <ClInclude Include="..\Include\osmodule.h" />
<ClInclude Include="..\Include\patchlevel.h" /> <ClInclude Include="..\Include\patchlevel.h" />
<ClInclude Include="..\Include\parser_interface.h" />
<ClInclude Include="..\Include\picklebufobject.h" />
<ClInclude Include="..\Include\py_curses.h" /> <ClInclude Include="..\Include\py_curses.h" />
<ClInclude Include="..\Include\pycapsule.h" /> <ClInclude Include="..\Include\pycapsule.h" />
<ClInclude Include="..\Include\pydebug.h" />
<ClInclude Include="..\Include\pyerrors.h" /> <ClInclude Include="..\Include\pyerrors.h" />
<ClInclude Include="..\Include\pyexpat.h" /> <ClInclude Include="..\Include\pyexpat.h" />
<ClInclude Include="..\Include\pyfpe.h" />
<ClInclude Include="..\Include\pyframe.h" /> <ClInclude Include="..\Include\pyframe.h" />
<ClInclude Include="..\Include\pyhash.h" /> <ClInclude Include="..\Include\pyhash.h" />
<ClInclude Include="..\Include\pylifecycle.h" /> <ClInclude Include="..\Include\pylifecycle.h" />

View File

@ -171,27 +171,18 @@
<ClInclude Include="..\Include\patchlevel.h"> <ClInclude Include="..\Include\patchlevel.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\picklebufobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\py_curses.h"> <ClInclude Include="..\Include\py_curses.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\pycapsule.h"> <ClInclude Include="..\Include\pycapsule.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\pydebug.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\pyerrors.h"> <ClInclude Include="..\Include\pyerrors.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\pyexpat.h"> <ClInclude Include="..\Include\pyexpat.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\pyfpe.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\pylifecycle.h"> <ClInclude Include="..\Include\pylifecycle.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
@ -378,9 +369,6 @@
<ClInclude Include="..\Modules\hashtable.h"> <ClInclude Include="..\Modules\hashtable.h">
<Filter>Modules</Filter> <Filter>Modules</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\odictobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Parser\pegen.h"> <ClInclude Include="..\Parser\pegen.h">
<Filter>Parser</Filter> <Filter>Parser</Filter>
</ClInclude> </ClInclude>
@ -420,6 +408,9 @@
<ClInclude Include="..\Include\cpython\listobject.h"> <ClInclude Include="..\Include\cpython\listobject.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\odictobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\unicodeobject.h"> <ClInclude Include="..\Include\cpython\unicodeobject.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
@ -432,15 +423,27 @@
<ClInclude Include="..\Include\cpython\object.h"> <ClInclude Include="..\Include\cpython\object.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\parser_interface.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\picklebufobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pyarena.h"> <ClInclude Include="..\Include\cpython\pyarena.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\pyctype.h"> <ClInclude Include="..\Include\cpython\pyctype.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\pydebug.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pyerrors.h"> <ClInclude Include="..\Include\cpython\pyerrors.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\pyfpe.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pymem.h"> <ClInclude Include="..\Include\cpython\pymem.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
@ -474,9 +477,6 @@
<ClInclude Include="..\Include\cpython\initconfig.h"> <ClInclude Include="..\Include\cpython\initconfig.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\parser_interface.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_warnings.h"> <ClInclude Include="..\Include\internal\pycore_warnings.h">
<Filter>Include\internal</Filter> <Filter>Include\internal</Filter>
</ClInclude> </ClInclude>

View File

@ -1,4 +1,4 @@
#include "parser_interface.h" #include "Python.h"
#include "tokenizer.h" #include "tokenizer.h"
#include "pegen.h" #include "pegen.h"

View File

@ -26,8 +26,6 @@
#include "symtable.h" // PySymtable_BuildObject() #include "symtable.h" // PySymtable_BuildObject()
#include "marshal.h" // PyMarshal_ReadLongFromFile() #include "marshal.h" // PyMarshal_ReadLongFromFile()
#include "parser_interface.h" // PyParser_ASTFrom*
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
# include "malloc.h" // alloca() # include "malloc.h" // alloca()
#endif #endif

View File

@ -23,7 +23,6 @@ EXCLUDED_HEADERS = {
"longintrepr.h", "longintrepr.h",
"parsetok.h", "parsetok.h",
"pyatomic.h", "pyatomic.h",
"pydebug.h",
"pytime.h", "pytime.h",
"symtable.h", "symtable.h",
"token.h", "token.h",