mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
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.
This commit is contained in:
parent
56c7176d1d
commit
d2e2e53f73
21 changed files with 89 additions and 169 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue