summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 15:19:30 (GMT)
committerGitHub <noreply@github.com>2022-02-25 15:19:30 (GMT)
commitf780d9690f1a009a56ac0c653ec9608e6b2aeff4 (patch)
treec79cf96660edaa02a5aede8e9d5e278822454072
parent8f2a337a80a283c66e1a4252839792fa229d2763 (diff)
downloadcpython-f780d9690f1a009a56ac0c653ec9608e6b2aeff4.zip
cpython-f780d9690f1a009a56ac0c653ec9608e6b2aeff4.tar.gz
cpython-f780d9690f1a009a56ac0c653ec9608e6b2aeff4.tar.bz2
bpo-45316: Move _PyArg_Fini() to internal C API (GH-31580)
Move the private unexported _PyArg_Fini() function to the internal C API: to the pycore_pylifecycle.h header file.
-rw-r--r--Include/internal/pycore_pylifecycle.h1
-rw-r--r--Include/modsupport.h2
-rw-r--r--Python/getargs.c1
-rw-r--r--Python/pylifecycle.c2
4 files changed, 3 insertions, 3 deletions
diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h
index deac6ee..00d13b8 100644
--- a/Include/internal/pycore_pylifecycle.h
+++ b/Include/internal/pycore_pylifecycle.h
@@ -84,6 +84,7 @@ extern void _PyAST_Fini(PyInterpreterState *interp);
extern void _PyAtExit_Fini(PyInterpreterState *interp);
extern void _PyThread_FiniType(PyInterpreterState *interp);
extern void _Py_Deepfreeze_Fini(void);
+extern void _PyArg_Fini(void);
extern PyStatus _PyGILState_Init(_PyRuntimeState *runtime);
extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate);
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 6cc2ad0..3cfefb4 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -141,8 +141,6 @@ PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
(minpos) <= (nargs) && (nargs) <= (maxpos) && args != NULL) ? (args) : \
_PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
(minpos), (maxpos), (minkw), (buf)))
-
-void _PyArg_Fini(void);
#endif /* Py_LIMITED_API */
// Add an attribute with name 'name' and value 'obj' to the module 'mod.
diff --git a/Python/getargs.c b/Python/getargs.c
index 3fab3b5..a2ea4d7 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -3,6 +3,7 @@
#include "Python.h"
#include "pycore_tuple.h" // _PyTuple_ITEMS()
+#include "pycore_pylifecycle.h" // _PyArg_Fini
#include <ctype.h>
#include <float.h>
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 9dd769a..a671bca 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -829,7 +829,7 @@ pycore_interp_init(PyThreadState *tstate)
// Intern strings in deep-frozen modules first so that others
// can use it instead of creating a heap allocated string.
_Py_Deepfreeze_Init();
-
+
status = pycore_init_types(interp);
if (_PyStatus_EXCEPTION(status)) {
goto done;