mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (gh-104072)
Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
This commit is contained in:
parent
b1ca34d4d5
commit
fdd878650d
17 changed files with 146 additions and 135 deletions
|
@ -1663,8 +1663,10 @@ flush_std_files(void)
|
|||
static void
|
||||
finalize_interp_types(PyInterpreterState *interp)
|
||||
{
|
||||
_PyIO_FiniTypes(interp);
|
||||
|
||||
_PyUnicode_FiniTypes(interp);
|
||||
_PySys_Fini(interp);
|
||||
_PySys_FiniTypes(interp);
|
||||
_PyExc_Fini(interp);
|
||||
_PyAsyncGen_Fini(interp);
|
||||
_PyContext_Fini(interp);
|
||||
|
@ -1706,8 +1708,6 @@ finalize_interp_clear(PyThreadState *tstate)
|
|||
/* Clear interpreter state and all thread states */
|
||||
_PyInterpreterState_Clear(tstate);
|
||||
|
||||
_PyIO_FiniTypes(tstate->interp);
|
||||
|
||||
/* Clear all loghooks */
|
||||
/* Both _PySys_Audit function and users still need PyObject, such as tuple.
|
||||
Call _PySys_ClearAuditHooks when PyObject available. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue