mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-104341: Adjust tstate_must_exit() to Respect Interpreter Finalization (gh-104437)
With the move to a per-interpreter GIL, this check slipped through the cracks.
This commit is contained in:
parent
cb88ae635e
commit
26baa747c2
11 changed files with 56 additions and 10 deletions
|
@ -332,6 +332,7 @@ _PySys_ClearAuditHooks(PyThreadState *ts)
|
|||
}
|
||||
|
||||
_PyRuntimeState *runtime = ts->interp->runtime;
|
||||
/* The hooks are global so we have to check for runtime finalization. */
|
||||
PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime);
|
||||
assert(finalizing == ts);
|
||||
if (finalizing != ts) {
|
||||
|
@ -2039,6 +2040,9 @@ sys__clear_type_cache_impl(PyObject *module)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* Note that, for now, we do not have a per-interpreter equivalent
|
||||
for sys.is_finalizing(). */
|
||||
|
||||
/*[clinic input]
|
||||
sys.is_finalizing
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue