summaryrefslogtreecommitdiffstats
path: root/Python/errors.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/errors.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/errors.c')
-rw-r--r--Python/errors.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Python/errors.c b/Python/errors.c
index ce72049..a8000ac 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1342,8 +1342,9 @@ static PyStructSequence_Desc UnraisableHookArgs_desc = {
PyStatus
_PyErr_InitTypes(PyInterpreterState *interp)
{
- if (_PyStructSequence_InitBuiltin(&UnraisableHookArgsType,
- &UnraisableHookArgs_desc) < 0) {
+ if (_PyStructSequence_InitBuiltin(interp, &UnraisableHookArgsType,
+ &UnraisableHookArgs_desc) < 0)
+ {
return _PyStatus_ERR("failed to initialize UnraisableHookArgs type");
}
return _PyStatus_OK();
@@ -1353,11 +1354,7 @@ _PyErr_InitTypes(PyInterpreterState *interp)
void
_PyErr_FiniTypes(PyInterpreterState *interp)
{
- if (!_Py_IsMainInterpreter(interp)) {
- return;
- }
-
- _PyStructSequence_FiniBuiltin(&UnraisableHookArgsType);
+ _PyStructSequence_FiniBuiltin(interp, &UnraisableHookArgsType);
}