]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45316: Move _PyArg_Fini() to internal C API (GH-31580)
authorVictor Stinner <vstinner@python.org>
Fri, 25 Feb 2022 15:19:30 +0000 (16:19 +0100)
committerGitHub <noreply@github.com>
Fri, 25 Feb 2022 15:19:30 +0000 (16:19 +0100)
Move the private unexported _PyArg_Fini() function to the internal C
API: to the pycore_pylifecycle.h header file.

Include/internal/pycore_pylifecycle.h
Include/modsupport.h
Python/getargs.c
Python/pylifecycle.c

index deac6ee3d3f41b90550d6e05c6fbe4c3e521b1c8..00d13b85d2c25b9884beeffbfb5a112347f95a03 100644 (file)
@@ -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);
index 6cc2ad01ebe96e3166e2f7448572104ab894c49e..3cfefb413ca55adc3af766284dfa3f4a4908940c 100644 (file)
@@ -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.
index 3fab3b5efefc286c41d2cc6b80fd36a8a61ece88..a2ea4d7da45f83c31bd5e50e8d4ec21d2fe19743 100644 (file)
@@ -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>
index 9dd769a0e87b10fb788d1f076c9a2d0203a8d763..a671bcaf42c6601e6becfa23c0e01af25119d810 100644 (file)
@@ -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;