summaryrefslogtreecommitdiffstats
path: root/Modules/_io
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 /Modules/_io
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 'Modules/_io')
-rw-r--r--Modules/_io/bufferedio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 6f291c3..7a0c516 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -293,7 +293,8 @@ _enter_buffered_busy(buffered *self)
"reentrant call inside %R", self);
return 0;
}
- relax_locking = _Py_IsFinalizing();
+ PyInterpreterState *interp = PyInterpreterState_Get();
+ relax_locking = _Py_IsInterpreterFinalizing(interp);
Py_BEGIN_ALLOW_THREADS
if (!relax_locking)
st = PyThread_acquire_lock(self->lock, 1);