summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-02-05 18:28:51 (GMT)
committerGitHub <noreply@github.com>2024-02-05 18:28:51 (GMT)
commit36518e69d74607e5f094ce55286188e4545a947d (patch)
treeb031b3cb351b68e5bee0ad4bf346fd958b2b9307 /Objects/structseq.c
parentb4ba0f73d6eef3da321bb96aafd09dfbc572e95d (diff)
downloadcpython-36518e69d74607e5f094ce55286188e4545a947d.zip
cpython-36518e69d74607e5f094ce55286188e4545a947d.tar.gz
cpython-36518e69d74607e5f094ce55286188e4545a947d.tar.bz2
GH-108362: Incremental GC implementation (GH-108038)
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 581d6ad..661d96a 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -603,6 +603,9 @@ _PyStructSequence_InitBuiltinWithFlags(PyInterpreterState *interp,
PyStructSequence_Desc *desc,
unsigned long tp_flags)
{
+ if (Py_TYPE(type) == NULL) {
+ Py_SET_TYPE(type, &PyType_Type);
+ }
Py_ssize_t n_unnamed_members;
Py_ssize_t n_members = count_members(desc, &n_unnamed_members);
PyMemberDef *members = NULL;
@@ -618,7 +621,7 @@ _PyStructSequence_InitBuiltinWithFlags(PyInterpreterState *interp,
}
initialize_static_fields(type, desc, members, tp_flags);
- _Py_SetImmortal(type);
+ _Py_SetImmortal((PyObject *)type);
}
#ifndef NDEBUG
else {