summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-21 02:30:20 (GMT)
committerGitHub <noreply@github.com>2022-01-21 02:30:20 (GMT)
commit1781d55eb34f94029e50970232635fc5082378cb (patch)
tree613d5c847480facfe411345b4a61ee3239950e53 /Include
parent17f268a4ae6190b2659c89c6f32ad2d006e0e3c8 (diff)
downloadcpython-1781d55eb34f94029e50970232635fc5082378cb.zip
cpython-1781d55eb34f94029e50970232635fc5082378cb.tar.gz
cpython-1781d55eb34f94029e50970232635fc5082378cb.tar.bz2
bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)
The _curses module now creates its ncurses_version type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Move _PyStructSequence_FiniType() definition to pycore_structseq.h. * test.pythoninfo: log curses.ncurses_version.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_structseq.h5
-rw-r--r--Include/structseq.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/Include/internal/pycore_structseq.h b/Include/internal/pycore_structseq.h
index 3a61cb9..c0323bb 100644
--- a/Include/internal/pycore_structseq.h
+++ b/Include/internal/pycore_structseq.h
@@ -16,11 +16,16 @@ extern PyStatus _PyStructSequence_InitState(PyInterpreterState *);
/* other API */
+PyAPI_FUNC(PyTypeObject *) _PyStructSequence_NewType(
+ PyStructSequence_Desc *desc,
+ unsigned long tp_flags);
+
PyAPI_FUNC(int) _PyStructSequence_InitType(
PyTypeObject *type,
PyStructSequence_Desc *desc,
unsigned long tp_flags);
+extern void _PyStructSequence_FiniType(PyTypeObject *type);
#ifdef __cplusplus
}
diff --git a/Include/structseq.h b/Include/structseq.h
index 8abd244..e89265a 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -27,9 +27,6 @@ PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
PyStructSequence_Desc *desc);
#endif
-#ifdef Py_BUILD_CORE
-PyAPI_FUNC(void) _PyStructSequence_FiniType(PyTypeObject *type);
-#endif
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);