Skip to content

Commit c2931d3

Browse files
authored
bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854)
1 parent 440c025 commit c2931d3

File tree

10 files changed

+26
-9
lines changed

10 files changed

+26
-9
lines changed

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,6 @@ Py_tp_setattro
918918
Py_tp_str
919919
Py_tp_traverse
920920
Py_uintptr_t
921-
_PyStructSequence_InitType
922921
_frame
923922
_node
924923
allocfunc

Include/internal/pycore_structseq.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef Py_INTERNAL_STRUCTSEQ_H
2+
#define Py_INTERNAL_STRUCTSEQ_H
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
7+
#ifndef Py_BUILD_CORE
8+
# error "this header requires Py_BUILD_CORE define"
9+
#endif
10+
11+
12+
PyAPI_FUNC(int) _PyStructSequence_InitType(
13+
PyTypeObject *type,
14+
PyStructSequence_Desc *desc,
15+
unsigned long tp_flags);
16+
17+
18+
#ifdef __cplusplus
19+
}
20+
#endif
21+
#endif /* !Py_INTERNAL_STRUCTSEQ_H */

Include/structseq.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
2727
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
2828
PyStructSequence_Desc *desc);
2929
#endif
30-
PyAPI_FUNC(int) _PyStructSequence_InitType(
31-
PyTypeObject *type,
32-
PyStructSequence_Desc *desc,
33-
unsigned long tp_flags);
3430
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
3531

3632
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ PYTHON_HEADERS= \
11711171
$(srcdir)/Include/internal/pycore_pymem.h \
11721172
$(srcdir)/Include/internal/pycore_pystate.h \
11731173
$(srcdir)/Include/internal/pycore_runtime.h \
1174+
$(srcdir)/Include/internal/pycore_structseq.h \
11741175
$(srcdir)/Include/internal/pycore_symtable.h \
11751176
$(srcdir)/Include/internal/pycore_sysmodule.h \
11761177
$(srcdir)/Include/internal/pycore_traceback.h \

Misc/stable_abi.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,8 +2121,6 @@ function PyObject_GetAiter
21212121
added 3.10
21222122
data PyExc_EncodingWarning
21232123
added 3.10
2124-
function _PyStructSequence_InitType
2125-
added 3.10
21262124

21272125
# Support for Stable ABI in debug builds
21282126

Modules/_cursesmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static const char PyCursesVersion[] = "2.2";
104104

105105
#include "Python.h"
106106
#include "pycore_long.h" // _PyLong_GetZero()
107-
107+
#include "pycore_structseq.h" // PyStructSequence_InitType()
108108

109109
#ifdef __hpux
110110
#define STRICT_SYSV_CURSES

Objects/structseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "pycore_tuple.h" // _PyTuple_FromArray()
1212
#include "pycore_object.h" // _PyObject_GC_TRACK()
1313
#include "structmember.h" // PyMemberDef
14+
#include "pycore_structseq.h" // PyStructSequence_InitType()
1415

1516
static const char visible_length_key[] = "n_sequence_fields";
1617
static const char real_length_key[] = "n_fields";

PC/python3dll.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ EXPORT_FUNC(_PyObject_GC_Resize)
3535
EXPORT_FUNC(_PyObject_New)
3636
EXPORT_FUNC(_PyObject_NewVar)
3737
EXPORT_FUNC(_PyState_AddModule)
38-
EXPORT_FUNC(_PyStructSequence_InitType)
3938
EXPORT_FUNC(_PyThreadState_Init)
4039
EXPORT_FUNC(_PyThreadState_Prealloc)
4140
EXPORT_FUNC(_PyTrash_deposit_object)

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
<ClInclude Include="..\Include\internal\pycore_pymem.h" />
210210
<ClInclude Include="..\Include\internal\pycore_pystate.h" />
211211
<ClInclude Include="..\Include\internal\pycore_runtime.h" />
212+
<ClInclude Include="..\Include\internal\pycore_structseq.h" />
212213
<ClInclude Include="..\Include\internal\pycore_sysmodule.h" />
213214
<ClInclude Include="..\Include\internal\pycore_symtable.h" />
214215
<ClInclude Include="..\Include\internal\pycore_traceback.h" />

Python/sysmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Data members:
2424
#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator()
2525
#include "pycore_pystate.h" // _PyThreadState_GET()
2626
#include "pycore_tuple.h" // _PyTuple_FromArray()
27+
#include "pycore_structseq.h" // PyStructSequence_InitType()
2728

2829
#include "code.h"
2930
#include "frameobject.h" // PyFrame_GetBack()

0 commit comments

Comments
 (0)