mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +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
|
|
@ -198,7 +198,7 @@ get_warnings_attr(PyInterpreterState *interp, PyObject *attr, int try_import)
|
|||
PyObject *warnings_module, *obj;
|
||||
|
||||
/* don't try to import after the start of the Python finallization */
|
||||
if (try_import && !_Py_IsFinalizing()) {
|
||||
if (try_import && !_Py_IsInterpreterFinalizing(interp)) {
|
||||
warnings_module = PyImport_Import(&_Py_ID(warnings));
|
||||
if (warnings_module == NULL) {
|
||||
/* Fallback to the C implementation if we cannot get
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue