summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.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 /Objects/exceptions.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 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 6c9dfbd..ba5ee29 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -3598,7 +3598,7 @@ _PyExc_InitTypes(PyInterpreterState *interp)
{
for (size_t i=0; i < Py_ARRAY_LENGTH(static_exceptions); i++) {
PyTypeObject *exc = static_exceptions[i].exc;
- if (_PyStaticType_InitBuiltin(exc) < 0) {
+ if (_PyStaticType_InitBuiltin(interp, exc) < 0) {
return -1;
}
}
@@ -3609,13 +3609,9 @@ _PyExc_InitTypes(PyInterpreterState *interp)
static void
_PyExc_FiniTypes(PyInterpreterState *interp)
{
- if (!_Py_IsMainInterpreter(interp)) {
- return;
- }
-
for (Py_ssize_t i=Py_ARRAY_LENGTH(static_exceptions) - 1; i >= 0; i--) {
PyTypeObject *exc = static_exceptions[i].exc;
- _PyStaticType_Dealloc(exc);
+ _PyStaticType_Dealloc(interp, exc);
}
}