diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-04-27 22:19:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 22:19:43 (GMT) |
commit | d2e2e53f733f8c8098035bbbc452bd1892796cb3 (patch) | |
tree | 4f01c11ff1f6ad9ebbcd4786bca991878226a4c6 /Python/errors.c | |
parent | 56c7176d1de3a0770085cad3865c1de42ba86f42 (diff) | |
download | cpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.zip cpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.tar.gz cpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.tar.bz2 |
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.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Python/errors.c b/Python/errors.c index 0ff6a0d..7fc2673 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(); } |