From 366dc3a1354078e38808b9c16276e97cca5b8aaf Mon Sep 17 00:00:00 2001 From: Nicholas Sim Date: Thu, 18 Feb 2021 02:30:31 +0800 Subject: [PATCH] bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550) Move non-limited C API headers pyarena.h and pyctype.h into Include/cpython/ directory. --- Include/Python.h | 4 ++-- Include/{ => cpython}/pyarena.h | 0 Include/{ => cpython}/pyctype.h | 0 Makefile.pre.in | 4 ++-- .../C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst | 3 +++ PCbuild/pythoncore.vcxproj | 4 ++-- PCbuild/pythoncore.vcxproj.filters | 12 ++++++------ Parser/pegen.h | 1 - Tools/scripts/stable_abi.py | 2 -- 9 files changed, 15 insertions(+), 15 deletions(-) rename Include/{ => cpython}/pyarena.h (100%) rename Include/{ => cpython}/pyctype.h (100%) create mode 100644 Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst diff --git a/Include/Python.h b/Include/Python.h index 76ead9e5765..c71a71f875e 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 d3ac2dab893..593da93a6bc 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1057,9 +1057,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 \ @@ -1113,6 +1111,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 00000000000..c3534fce68f --- /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 711a68fcc5c..89b6218a273 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 ab826427acc..bd8fd3433bc 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 2a165c12d25..3765b2425ff 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 117dfeb3cb5..44f426e096a 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -22,9 +22,7 @@ EXCLUDED_HEADERS = { "genobject.h", "longintrepr.h", "parsetok.h", - "pyarena.h", "pyatomic.h", - "pyctype.h", "pydebug.h", "pytime.h", "symtable.h",