Skip to content

Commit

Permalink
Fix static_builtin_state_init().
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Apr 27, 2023
1 parent 707310a commit abae429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ static_builtin_state_init(PyTypeObject *self)
PyInterpreterState *interp = _PyInterpreterState_GET();

/* It should only be called once for each builtin type. */
assert(!static_builtin_index_is_set(self));

static_builtin_index_set(self, interp->types.num_builtins_initialized);
interp->types.num_builtins_initialized++;
if (!static_builtin_index_is_set(self)) {
static_builtin_index_set(self, interp->types.num_builtins_initialized);
interp->types.num_builtins_initialized++;
}

static_builtin_state *state = static_builtin_state_get(interp, self);
state->type = self;
Expand Down

0 comments on commit abae429

Please # to comment.