Skip to content

Commit 86f8ec6

Browse files
Fix the short-circuit in type_ready_set_bases().
1 parent fe12a90 commit 86f8ec6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Objects/typeobject.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7045,8 +7045,12 @@ type_ready_set_type(PyTypeObject *type)
70457045
static int
70467046
type_ready_set_bases(PyTypeObject *type)
70477047
{
7048-
if (lookup_tp_bases(type) != NULL) {
7049-
return 0;
7048+
if (type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) {
7049+
if (!_Py_IsMainInterpreter(_PyInterpreterState_GET())) {
7050+
assert(lookup_tp_bases(type) != NULL);
7051+
return 0;
7052+
}
7053+
assert(lookup_tp_bases(type) == NULL);
70507054
}
70517055

70527056
PyObject *bases = lookup_tp_bases(type);

0 commit comments

Comments
 (0)