mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)
This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
619cadcda6
commit
a088290f9d
10 changed files with 66 additions and 55 deletions
|
|
@ -1483,6 +1483,10 @@ def generate_ast_fini(module_state, f):
|
|||
for s in module_state:
|
||||
f.write(" Py_CLEAR(state->" + s + ');\n')
|
||||
f.write(textwrap.dedent("""
|
||||
if (_PyInterpreterState_Get() == _PyInterpreterState_Main()) {
|
||||
Py_CLEAR(_Py_CACHED_OBJECT(str_replace_inf));
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
state->initialized = -1;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue