diff --git a/Include/Python.h b/Include/Python.h index 76ead9e5765ec8..c71a71f875e3e4 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -137,7 +137,7 @@ #include "pystate.h" #include "context.h" -#include "pyarena.h" +#include "cpython/pyarena.h" #include "modsupport.h" #include "compile.h" #include "pythonrun.h" @@ -154,7 +154,7 @@ #include "eval.h" -#include "pyctype.h" +#include "cpython/pyctype.h" #include "pystrtod.h" #include "pystrcmp.h" #include "fileutils.h" diff --git a/Include/pyarena.h b/Include/cpython/pyarena.h similarity index 100% rename from Include/pyarena.h rename to Include/cpython/pyarena.h diff --git a/Include/pyctype.h b/Include/cpython/pyctype.h similarity index 100% rename from Include/pyctype.h rename to Include/cpython/pyctype.h diff --git a/Makefile.pre.in b/Makefile.pre.in index 0d9fdc713406c0..ef3ca276302911 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1054,9 +1054,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/osmodule.h \ $(srcdir)/Include/patchlevel.h \ $(srcdir)/Include/picklebufobject.h \ - $(srcdir)/Include/pyarena.h \ $(srcdir)/Include/pycapsule.h \ - $(srcdir)/Include/pyctype.h \ $(srcdir)/Include/pydebug.h \ $(srcdir)/Include/pydtrace.h \ $(srcdir)/Include/pyerrors.h \ @@ -1110,6 +1108,8 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/methodobject.h \ $(srcdir)/Include/cpython/object.h \ $(srcdir)/Include/cpython/objimpl.h \ + $(srcdir)/Include/cpython/pyarena.h \ + $(srcdir)/Include/cpython/pyctype.h \ $(srcdir)/Include/cpython/pyerrors.h \ $(srcdir)/Include/cpython/pylifecycle.h \ $(srcdir)/Include/cpython/pymem.h \ diff --git a/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst b/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst new file mode 100644 index 00000000000000..c3534fce68f83f --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst @@ -0,0 +1,3 @@ +Move pyarena.h, pyctype.h, and pytime.h into the cpython/ directory. They +must not be included directly, as they are already included by Python.h: +:ref:`Include Files `. diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 711a68fcc5c7ad..89b6218a2739a5 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -142,6 +142,8 @@ + + @@ -226,9 +228,7 @@ - - diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index ab826427acc688..bd8fd3433bce0a 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -177,15 +177,9 @@ Include - - Include - Include - - Include - Include @@ -438,6 +432,12 @@ Include\cpython + + Include + + + Include + Include\cpython diff --git a/Parser/pegen.h b/Parser/pegen.h index 2a165c12d252c1..3765b2425fff7e 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -5,7 +5,6 @@ #include #include #include -#include #if 0 #define PyPARSE_YIELD_IS_KEYWORD 0x0001 diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py index 47547a97bfd318..db187be3492cca 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -21,9 +21,7 @@ "genobject.h", "longintrepr.h", "parsetok.h", - "pyarena.h", "pyatomic.h", - "pyctype.h", "pydebug.h", "pytime.h", "symtable.h",