Make PyXXX_Fini() functions private (GH-15531)
For example, rename PyTuple_Fini() to _PyTuple_Fini().
These functions are only declared in the internal C API.
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index c4edcca..6d55330 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3047,7 +3047,7 @@
}
void
-PyBytes_Fini(void)
+_PyBytes_Fini(void)
{
int i;
for (i = 0; i < UCHAR_MAX + 1; i++)
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 40cbeaa..4a9add1 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -375,7 +375,7 @@
}
void
-PyMethod_Fini(void)
+_PyMethod_Fini(void)
{
(void)PyMethod_ClearFreeList();
}
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index fec3a87..73956df 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -282,7 +282,7 @@
void
-PyDict_Fini(void)
+_PyDict_Fini(void)
{
PyDict_ClearFreeList();
}
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 689e929..6643ff3 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -2031,7 +2031,7 @@
}
void
-PyFloat_Fini(void)
+_PyFloat_Fini(void)
{
(void)PyFloat_ClearFreeList();
}
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index a796a59..27ef9ff 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -997,7 +997,7 @@
}
void
-PyFrame_Fini(void)
+_PyFrame_Fini(void)
{
(void)PyFrame_ClearFreeList();
}
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 5d1f9c7..5e0bfa4 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -1463,7 +1463,7 @@
}
void
-PyAsyncGen_Fini(void)
+_PyAsyncGen_Fini(void)
{
PyAsyncGen_ClearFreeLists();
}
diff --git a/Objects/listobject.c b/Objects/listobject.c
index cea9b24..5fca08e 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -138,7 +138,7 @@
}
void
-PyList_Fini(void)
+_PyList_Fini(void)
{
PyList_ClearFreeList();
}
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 74037be..475b9bd 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -5869,7 +5869,7 @@
}
void
-PyLong_Fini(void)
+_PyLong_Fini(void)
{
/* Integers are currently statically allocated. Py_DECREF is not
needed, but Python must forget about the reference or multiple
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index b997746..7d70cc0 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -319,7 +319,7 @@
}
void
-PyCFunction_Fini(void)
+_PyCFunction_Fini(void)
{
(void)PyCFunction_ClearFreeList();
}
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 8cd95ba..56858db 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -2318,7 +2318,7 @@
}
void
-PySet_Fini(void)
+_PySet_Fini(void)
{
Py_CLEAR(emptyfrozenset);
}
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 7c10eb6..e884a58 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -100,7 +100,8 @@
* created and then deleted again
*/
static PySliceObject *slice_cache = NULL;
-void PySlice_Fini(void)
+
+void _PySlice_Fini(void)
{
PySliceObject *obj = slice_cache;
if (obj != NULL) {
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 79a5d55..3419baa 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -989,7 +989,7 @@
}
void
-PyTuple_Fini(void)
+_PyTuple_Fini(void)
{
#if PyTuple_MAXSAVESIZE > 0
/* empty tuples are used all over the place and applications may