Skip to content

Commit

Permalink
Call initialize_structseq_dict() for subinterpreters.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Apr 27, 2023
1 parent abae429 commit 7ccc2e4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Objects/structseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,21 @@ _PyStructSequence_InitBuiltinWithFlags(PyTypeObject *type,
PyStructSequence_Desc *desc,
unsigned long tp_flags)
{
PyMemberDef *members;
Py_ssize_t n_members, n_unnamed_members;

if (type->tp_flags & Py_TPFLAGS_READY) {
if (_PyStaticType_InitBuiltin(type) < 0) {
goto failed_init_builtin;
}
n_members = count_members(desc, &n_unnamed_members);
if (initialize_structseq_dict(
desc, _PyType_GetDict(type), n_members, n_unnamed_members) < 0) {
return -1;
}
return 0;
}

PyMemberDef *members;
Py_ssize_t n_members, n_unnamed_members;

members = initialize_members(desc, &n_members, &n_unnamed_members);
if (members == NULL) {
return -1;
Expand Down

0 comments on commit 7ccc2e4

Please # to comment.