From d2e2e53f733f8c8098035bbbc452bd1892796cb3 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Thu, 27 Apr 2023 16:19:43 -0600 Subject: gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940) There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL. --- Python/errors.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Python/errors.c') diff --git a/Python/errors.c b/Python/errors.c index 0ff6a0d598..7fc267385c 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -1342,15 +1342,9 @@ static PyStructSequence_Desc UnraisableHookArgs_desc = { PyStatus _PyErr_InitTypes(PyInterpreterState *interp) { - if (!_Py_IsMainInterpreter(interp)) { - return _PyStatus_OK(); - } - - if (UnraisableHookArgsType.tp_name == NULL) { - if (_PyStructSequence_InitBuiltin(&UnraisableHookArgsType, - &UnraisableHookArgs_desc) < 0) { - return _PyStatus_ERR("failed to initialize UnraisableHookArgs type"); - } + if (_PyStructSequence_InitBuiltin(&UnraisableHookArgsType, + &UnraisableHookArgs_desc) < 0) { + return _PyStatus_ERR("failed to initialize UnraisableHookArgs type"); } return _PyStatus_OK(); } -- cgit v1.2.1