summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-15 19:59:26 (GMT)
committerGitHub <noreply@github.com>2023-05-15 19:59:26 (GMT)
commit26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b (patch)
treee54b52c2c950d59a20f4b0658d8eb2af3adec246 /Python/_warnings.c
parentcb88ae635e96d7020ba6187bcfd45ace4dcd8395 (diff)
downloadcpython-26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b.zip
cpython-26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b.tar.gz
cpython-26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b.tar.bz2
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.
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 5644db9..dec6586 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