summaryrefslogtreecommitdiffstats
path: root/Python/thread.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-02 01:36:00 (GMT)
committerGitHub <noreply@github.com>2023-05-02 01:36:00 (GMT)
commitfdd878650d325297cd801305bc2d1b0e903e42b4 (patch)
tree9814f09627ef014852dcc3fa462dfec30e5e591d /Python/thread.c
parentb1ca34d4d5e463b8108eea20090f12292390f0cf (diff)
downloadcpython-fdd878650d325297cd801305bc2d1b0e903e42b4.zip
cpython-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.gz
cpython-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.bz2
gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (gh-104072)
Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
Diffstat (limited to 'Python/thread.c')
-rw-r--r--Python/thread.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/thread.c b/Python/thread.c
index f90cd34..7fc53f9 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -137,7 +137,8 @@ PyThread_GetInfo(void)
int len;
#endif
- if (_PyStructSequence_InitBuiltin(&ThreadInfoType, &threadinfo_desc) < 0) {
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (_PyStructSequence_InitBuiltin(interp, &ThreadInfoType, &threadinfo_desc) < 0) {
return NULL;
}
@@ -191,9 +192,5 @@ PyThread_GetInfo(void)
void
_PyThread_FiniType(PyInterpreterState *interp)
{
- if (!_Py_IsMainInterpreter(interp)) {
- return;
- }
-
- _PyStructSequence_FiniBuiltin(&ThreadInfoType);
+ _PyStructSequence_FiniBuiltin(interp, &ThreadInfoType);
}