Skip to content

Commit 116959a

Browse files
Fix the short-circuit in type_ready_set_bases().
1 parent 6e4c0bc commit 116959a

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
@@ -7037,8 +7037,12 @@ type_ready_set_type(PyTypeObject *type)
70377037
static int
70387038
type_ready_set_bases(PyTypeObject *type)
70397039
{
7040-
if (lookup_tp_bases(type) != NULL) {
7041-
return 0;
7040+
if (type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) {
7041+
if (!_Py_IsMainInterpreter(_PyInterpreterState_GET())) {
7042+
assert(lookup_tp_bases(type) != NULL);
7043+
return 0;
7044+
}
7045+
assert(lookup_tp_bases(type) == NULL);
70427046
}
70437047

70447048
PyObject *bases = lookup_tp_bases(type);

0 commit comments

Comments
 (0)