Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix _PyStaticType_InitBuiltin() for subinterpreters.
  • Loading branch information
ericsnowcurrently committed May 2, 2023
commit de2a3c1165d5adc1ed8e38af2c8782ccec1b63ec
9 changes: 9 additions & 0 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6758,6 +6758,10 @@ type_ready_pre_checks(PyTypeObject *type)
static int
type_ready_set_bases(PyTypeObject *type)
{
if (lookup_tp_bases(type) != NULL) {
return 0;
}

/* Initialize tp_base (defaults to BaseObject unless that's us) */
PyTypeObject *base = type->tp_base;
if (base == NULL && type != &PyBaseObject_Type) {
Expand Down Expand Up @@ -7274,6 +7278,11 @@ _PyStaticType_InitBuiltin(PyInterpreterState *interp, PyTypeObject *self)
Otherwise we would initialize it here. */

assert(_PyType_CheckConsistency(self));
/* We must explicitly set these for subinterpreters.
tp_subclasses is set lazily. */
type_ready_set_dict(self);
type_ready_set_bases(self);
type_ready_mro(self);
return 0;
}

Expand Down