From 26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Mon, 15 May 2023 13:59:26 -0600 Subject: 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. --- Python/_warnings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/_warnings.c') diff --git a/Python/_warnings.c b/Python/_warnings.c index 5644db9a37..dec6586802 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -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 -- cgit v1.2.1