mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
bpo-36710: Remove PyImport_Cleanup() function (GH-14221)
* Rename PyImport_Cleanup() to _PyImport_Cleanup() and move it to the internal C API. Add 'tstate' parameters. * Remove documentation of _PyImport_Init(), PyImport_Cleanup(), _PyImport_Fini(). All three were documented as "For internal use only.".
This commit is contained in:
parent
7821b4c6d2
commit
987a0dcfa1
6 changed files with 7 additions and 20 deletions
|
@ -413,9 +413,8 @@ static const char * const sys_files[] = {
|
|||
/* Un-initialize things, as good as we can */
|
||||
|
||||
void
|
||||
PyImport_Cleanup(void)
|
||||
_PyImport_Cleanup(PyThreadState *tstate)
|
||||
{
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
PyObject *modules = interp->modules;
|
||||
if (modules == NULL) {
|
||||
|
|
|
@ -1225,7 +1225,7 @@ Py_FinalizeEx(void)
|
|||
_PySys_ClearAuditHooks();
|
||||
|
||||
/* Destroy all modules */
|
||||
PyImport_Cleanup();
|
||||
_PyImport_Cleanup(tstate);
|
||||
|
||||
/* Print debug stats if any */
|
||||
_PyEval_Fini();
|
||||
|
@ -1589,7 +1589,7 @@ Py_EndInterpreter(PyThreadState *tstate)
|
|||
if (tstate != interp->tstate_head || tstate->next != NULL)
|
||||
Py_FatalError("Py_EndInterpreter: not the last thread");
|
||||
|
||||
PyImport_Cleanup();
|
||||
_PyImport_Cleanup(tstate);
|
||||
PyInterpreterState_Clear(interp);
|
||||
PyThreadState_Swap(NULL);
|
||||
PyInterpreterState_Delete(interp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue