Skip to content

Commit 4a6bf27

Browse files
authored
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.
1 parent 839184f commit 4a6bf27

File tree

14 files changed

+42
-34
lines changed

14 files changed

+42
-34
lines changed

Doc/whatsnew/3.10.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,14 @@ Porting to Python 3.10
934934
bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test.
935935
(Contributed by Zackery Spytz and Victor Stinner in :issue:`30459`.)
936936
937+
* The non-limited API files ``odictobject.h``, ``parser_interface.h``,
938+
``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``,
939+
``pyfpe.h``, and ``pytime.h`` have been moved to the ``Include/cpython``
940+
directory. These files must not be included directly, as they are already
941+
included in ``Python.h``: :ref:`Include Files <api-includes>`. If they have
942+
been included directly, consider including ``Python.h`` instead.
943+
(Contributed by Nicholas Sim in :issue:`35134`)
944+
937945
Deprecated
938946
----------
939947

Include/Python.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
#include "typeslots.h"
9090
#include "pyhash.h"
9191

92-
#include "pydebug.h"
92+
#include "cpython/pydebug.h"
9393

9494
#include "bytearrayobject.h"
9595
#include "bytesobject.h"
@@ -104,7 +104,7 @@
104104
#include "tupleobject.h"
105105
#include "listobject.h"
106106
#include "dictobject.h"
107-
#include "odictobject.h"
107+
#include "cpython/odictobject.h"
108108
#include "enumobject.h"
109109
#include "setobject.h"
110110
#include "methodobject.h"
@@ -126,7 +126,7 @@
126126
#include "weakrefobject.h"
127127
#include "structseq.h"
128128
#include "namespaceobject.h"
129-
#include "picklebufobject.h"
129+
#include "cpython/picklebufobject.h"
130130
#include "cpython/pytime.h"
131131

132132
#include "codecs.h"
@@ -141,7 +141,7 @@
141141
#include "modsupport.h"
142142
#include "compile.h"
143143
#include "pythonrun.h"
144-
#include "parser_interface.h"
144+
#include "cpython/parser_interface.h"
145145
#include "pylifecycle.h"
146146
#include "ceval.h"
147147
#include "sysmodule.h"
@@ -158,7 +158,7 @@
158158
#include "pystrtod.h"
159159
#include "pystrcmp.h"
160160
#include "fileutils.h"
161-
#include "pyfpe.h"
161+
#include "cpython/pyfpe.h"
162162
#include "tracemalloc.h"
163163

164164
#endif /* !Py_PYTHON_H */
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Makefile.pre.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ PEGEN_OBJS= \
316316

317317

318318
PEGEN_HEADERS= \
319-
$(srcdir)/Include/parser_interface.h \
319+
$(srcdir)/Include/cpython/parser_interface.h \
320320
$(srcdir)/Parser/pegen.h \
321321
$(srcdir)/Parser/string_parser.h
322322

@@ -1056,17 +1056,13 @@ PYTHON_HEADERS= \
10561056
$(srcdir)/Include/namespaceobject.h \
10571057
$(srcdir)/Include/object.h \
10581058
$(srcdir)/Include/objimpl.h \
1059-
$(srcdir)/Include/odictobject.h \
10601059
$(srcdir)/Include/opcode.h \
10611060
$(srcdir)/Include/osdefs.h \
10621061
$(srcdir)/Include/osmodule.h \
10631062
$(srcdir)/Include/patchlevel.h \
1064-
$(srcdir)/Include/picklebufobject.h \
10651063
$(srcdir)/Include/pycapsule.h \
1066-
$(srcdir)/Include/pydebug.h \
10671064
$(srcdir)/Include/pydtrace.h \
10681065
$(srcdir)/Include/pyerrors.h \
1069-
$(srcdir)/Include/pyfpe.h \
10701066
$(srcdir)/Include/pyframe.h \
10711067
$(srcdir)/Include/pyhash.h \
10721068
$(srcdir)/Include/pylifecycle.h \
@@ -1116,9 +1112,13 @@ PYTHON_HEADERS= \
11161112
$(srcdir)/Include/cpython/methodobject.h \
11171113
$(srcdir)/Include/cpython/object.h \
11181114
$(srcdir)/Include/cpython/objimpl.h \
1115+
$(srcdir)/Include/cpython/odictobject.h \
1116+
$(srcdir)/Include/cpython/picklebufobject.h \
11191117
$(srcdir)/Include/cpython/pyarena.h \
11201118
$(srcdir)/Include/cpython/pyctype.h \
1119+
$(srcdir)/Include/cpython/pydebug.h \
11211120
$(srcdir)/Include/cpython/pyerrors.h \
1121+
$(srcdir)/Include/cpython/pyfpe.h \
11221122
$(srcdir)/Include/cpython/pylifecycle.h \
11231123
$(srcdir)/Include/cpython/pymem.h \
11241124
$(srcdir)/Include/cpython/pystate.h \
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Move odictobject.h, parser_interface.h, picklebufobject.h, pydebug.h, and
2+
pyfpe.h into the cpython/ directory. They must not be included directly, as
3+
they are already included by Python.h: :ref:`Include Files <api-includes>`.

PCbuild/pythoncore.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@
142142
<ClInclude Include="..\Include\cpython\methodobject.h" />
143143
<ClInclude Include="..\Include\cpython\object.h" />
144144
<ClInclude Include="..\Include\cpython\objimpl.h" />
145+
<ClInclude Include="..\Include\cpython\odictobject.h" />
146+
<ClInclude Include="..\Include\cpython\parser_interface.h" />
147+
<ClInclude Include="..\Include\cpython\picklebufobject.h" />
145148
<ClInclude Include="..\Include\cpython\pyarena.h" />
146149
<ClInclude Include="..\Include\cpython\pyctype.h" />
150+
<ClInclude Include="..\Include\cpython\pydebug.h" />
147151
<ClInclude Include="..\Include\cpython\pyerrors.h" />
152+
<ClInclude Include="..\Include\cpython\pyfpe.h" />
148153
<ClInclude Include="..\Include\cpython\pylifecycle.h" />
149154
<ClInclude Include="..\Include\cpython\pymem.h" />
150155
<ClInclude Include="..\Include\cpython\pystate.h" />
@@ -220,19 +225,14 @@
220225
<ClInclude Include="..\Include\namespaceobject.h" />
221226
<ClInclude Include="..\Include\object.h" />
222227
<ClInclude Include="..\Include\objimpl.h" />
223-
<ClInclude Include="..\Include\odictobject.h" />
224228
<ClInclude Include="..\Include\opcode.h" />
225229
<ClInclude Include="..\Include\osdefs.h" />
226230
<ClInclude Include="..\Include\osmodule.h" />
227231
<ClInclude Include="..\Include\patchlevel.h" />
228-
<ClInclude Include="..\Include\parser_interface.h" />
229-
<ClInclude Include="..\Include\picklebufobject.h" />
230232
<ClInclude Include="..\Include\py_curses.h" />
231233
<ClInclude Include="..\Include\pycapsule.h" />
232-
<ClInclude Include="..\Include\pydebug.h" />
233234
<ClInclude Include="..\Include\pyerrors.h" />
234235
<ClInclude Include="..\Include\pyexpat.h" />
235-
<ClInclude Include="..\Include\pyfpe.h" />
236236
<ClInclude Include="..\Include\pyframe.h" />
237237
<ClInclude Include="..\Include\pyhash.h" />
238238
<ClInclude Include="..\Include\pylifecycle.h" />

0 commit comments

Comments
 (0)