summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/whatsnew/3.10.rst8
-rw-r--r--Include/Python.h10
-rw-r--r--Include/cpython/odictobject.h (renamed from Include/odictobject.h)0
-rw-r--r--Include/cpython/parser_interface.h (renamed from Include/parser_interface.h)0
-rw-r--r--Include/cpython/picklebufobject.h (renamed from Include/picklebufobject.h)0
-rw-r--r--Include/cpython/pydebug.h (renamed from Include/pydebug.h)0
-rw-r--r--Include/cpython/pyfpe.h (renamed from Include/pyfpe.h)0
-rw-r--r--Makefile.pre.in10
-rw-r--r--Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst3
-rw-r--r--PCbuild/pythoncore.vcxproj10
-rw-r--r--PCbuild/pythoncore.vcxproj.filters30
-rw-r--r--Parser/peg_api.c2
-rw-r--r--Python/pythonrun.c2
-rwxr-xr-xTools/scripts/stable_abi.py1
14 files changed, 42 insertions, 34 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index b903b3e..c4a79b6 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -934,6 +934,14 @@ Porting to Python 3.10
bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test.
(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
----------
diff --git a/Include/Python.h b/Include/Python.h
index c71a71f..86dbbcf 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -89,7 +89,7 @@
#include "typeslots.h"
#include "pyhash.h"
-#include "pydebug.h"
+#include "cpython/pydebug.h"
#include "bytearrayobject.h"
#include "bytesobject.h"
@@ -104,7 +104,7 @@
#include "tupleobject.h"
#include "listobject.h"
#include "dictobject.h"
-#include "odictobject.h"
+#include "cpython/odictobject.h"
#include "enumobject.h"
#include "setobject.h"
#include "methodobject.h"
@@ -126,7 +126,7 @@
#include "weakrefobject.h"
#include "structseq.h"
#include "namespaceobject.h"
-#include "picklebufobject.h"
+#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"
#include "codecs.h"
@@ -141,7 +141,7 @@
#include "modsupport.h"
#include "compile.h"
#include "pythonrun.h"
-#include "parser_interface.h"
+#include "cpython/parser_interface.h"
#include "pylifecycle.h"
#include "ceval.h"
#include "sysmodule.h"
@@ -158,7 +158,7 @@
#include "pystrtod.h"
#include "pystrcmp.h"
#include "fileutils.h"
-#include "pyfpe.h"
+#include "cpython/pyfpe.h"
#include "tracemalloc.h"
#endif /* !Py_PYTHON_H */
diff --git a/Include/odictobject.h b/Include/cpython/odictobject.h
index e070413..e070413 100644
--- a/Include/odictobject.h
+++ b/Include/cpython/odictobject.h
diff --git a/Include/parser_interface.h b/Include/cpython/parser_interface.h
index 1c6576d..1c6576d 100644
--- a/Include/parser_interface.h
+++ b/Include/cpython/parser_interface.h
diff --git a/Include/picklebufobject.h b/Include/cpython/picklebufobject.h
index 0df2561..0df2561 100644
--- a/Include/picklebufobject.h
+++ b/Include/cpython/picklebufobject.h
diff --git a/Include/pydebug.h b/Include/cpython/pydebug.h
index 78bcb11..78bcb11 100644
--- a/Include/pydebug.h
+++ b/Include/cpython/pydebug.h
diff --git a/Include/pyfpe.h b/Include/cpython/pyfpe.h
index cc2def6..cc2def6 100644
--- a/Include/pyfpe.h
+++ b/Include/cpython/pyfpe.h
diff --git a/Makefile.pre.in b/Makefile.pre.in
index e4ac248..0f59700 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -316,7 +316,7 @@ PEGEN_OBJS= \
PEGEN_HEADERS= \
- $(srcdir)/Include/parser_interface.h \
+ $(srcdir)/Include/cpython/parser_interface.h \
$(srcdir)/Parser/pegen.h \
$(srcdir)/Parser/string_parser.h
@@ -1056,17 +1056,13 @@ PYTHON_HEADERS= \
$(srcdir)/Include/namespaceobject.h \
$(srcdir)/Include/object.h \
$(srcdir)/Include/objimpl.h \
- $(srcdir)/Include/odictobject.h \
$(srcdir)/Include/opcode.h \
$(srcdir)/Include/osdefs.h \
$(srcdir)/Include/osmodule.h \
$(srcdir)/Include/patchlevel.h \
- $(srcdir)/Include/picklebufobject.h \
$(srcdir)/Include/pycapsule.h \
- $(srcdir)/Include/pydebug.h \
$(srcdir)/Include/pydtrace.h \
$(srcdir)/Include/pyerrors.h \
- $(srcdir)/Include/pyfpe.h \
$(srcdir)/Include/pyframe.h \
$(srcdir)/Include/pyhash.h \
$(srcdir)/Include/pylifecycle.h \
@@ -1116,9 +1112,13 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/methodobject.h \
$(srcdir)/Include/cpython/object.h \
$(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 \
+ $(srcdir)/Include/cpython/pyfpe.h \
$(srcdir)/Include/cpython/pylifecycle.h \
$(srcdir)/Include/cpython/pymem.h \
$(srcdir)/Include/cpython/pystate.h \
diff --git a/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst b/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst
new file mode 100644
index 0000000..5384cb8
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst
@@ -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>`.
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 89b6218..92355a8 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -142,9 +142,14 @@
<ClInclude Include="..\Include\cpython\methodobject.h" />
<ClInclude Include="..\Include\cpython\object.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\pyctype.h" />
+ <ClInclude Include="..\Include\cpython\pydebug.h" />
<ClInclude Include="..\Include\cpython\pyerrors.h" />
+ <ClInclude Include="..\Include\cpython\pyfpe.h" />
<ClInclude Include="..\Include\cpython\pylifecycle.h" />
<ClInclude Include="..\Include\cpython\pymem.h" />
<ClInclude Include="..\Include\cpython\pystate.h" />
@@ -220,19 +225,14 @@
<ClInclude Include="..\Include\namespaceobject.h" />
<ClInclude Include="..\Include\object.h" />
<ClInclude Include="..\Include\objimpl.h" />
- <ClInclude Include="..\Include\odictobject.h" />
<ClInclude Include="..\Include\opcode.h" />
<ClInclude Include="..\Include\osdefs.h" />
<ClInclude Include="..\Include\osmodule.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\pycapsule.h" />
- <ClInclude Include="..\Include\pydebug.h" />
<ClInclude Include="..\Include\pyerrors.h" />
<ClInclude Include="..\Include\pyexpat.h" />
- <ClInclude Include="..\Include\pyfpe.h" />
<ClInclude Include="..\Include\pyframe.h" />
<ClInclude Include="..\Include\pyhash.h" />
<ClInclude Include="..\Include\pylifecycle.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index bd8fd34..d0b69db 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -171,27 +171,18 @@
<ClInclude Include="..\Include\patchlevel.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\picklebufobject.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\py_curses.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\pycapsule.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\pydebug.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\pyerrors.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\pyexpat.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\pyfpe.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\pylifecycle.h">
<Filter>Include</Filter>
</ClInclude>
@@ -378,9 +369,6 @@
<ClInclude Include="..\Modules\hashtable.h">
<Filter>Modules</Filter>
</ClInclude>
- <ClInclude Include="..\Include\odictobject.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Parser\pegen.h">
<Filter>Parser</Filter>
</ClInclude>
@@ -420,6 +408,9 @@
<ClInclude Include="..\Include\cpython\listobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\cpython\odictobject.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\cpython\unicodeobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
@@ -432,15 +423,27 @@
<ClInclude Include="..\Include\cpython\object.h">
<Filter>Include\cpython</Filter>
</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">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pyctype.h">
<Filter>Include</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\cpython\pydebug.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\cpython\pyerrors.h">
<Filter>Include\cpython</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\cpython\pyfpe.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\cpython\pymem.h">
<Filter>Include\cpython</Filter>
</ClInclude>
@@ -474,9 +477,6 @@
<ClInclude Include="..\Include\cpython\initconfig.h">
<Filter>Include\cpython</Filter>
</ClInclude>
- <ClInclude Include="..\Include\parser_interface.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\internal\pycore_warnings.h">
<Filter>Include\internal</Filter>
</ClInclude>
diff --git a/Parser/peg_api.c b/Parser/peg_api.c
index 8381d5e..1555dea 100644
--- a/Parser/peg_api.c
+++ b/Parser/peg_api.c
@@ -1,4 +1,4 @@
-#include "parser_interface.h"
+#include "Python.h"
#include "tokenizer.h"
#include "pegen.h"
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index dacf1a6..338a1b9 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -26,8 +26,6 @@
#include "symtable.h" // PySymtable_BuildObject()
#include "marshal.h" // PyMarshal_ReadLongFromFile()
-#include "parser_interface.h" // PyParser_ASTFrom*
-
#ifdef MS_WINDOWS
# include "malloc.h" // alloca()
#endif
diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py
index 44f426e..cc1009d 100755
--- a/Tools/scripts/stable_abi.py
+++ b/Tools/scripts/stable_abi.py
@@ -23,7 +23,6 @@ EXCLUDED_HEADERS = {
"longintrepr.h",
"parsetok.h",
"pyatomic.h",
- "pydebug.h",
"pytime.h",
"symtable.h",
"token.h",