Skip to content
Prev Previous commit
Next Next commit
Flip around the condition in static_builtin_state_init().
  • Loading branch information
ericsnowcurrently committed Apr 12, 2024
commit 7cf7c04e08eae0744f6d45e876f92df7c2265693
5 changes: 2 additions & 3 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ _PyStaticType_GetState(PyInterpreterState *interp, PyTypeObject *self)
static void
static_builtin_state_init(PyInterpreterState *interp, PyTypeObject *self)
{
if (!static_builtin_index_is_set(self)) {
assert(_Py_IsMainInterpreter(interp));
if (_Py_IsMainInterpreter(interp)) {
assert(!static_builtin_index_is_set(self));
static_builtin_index_set(self, interp->types.num_builtins_initialized);
}
else {
assert(!_Py_IsMainInterpreter(interp));
assert(static_builtin_index_get(self) == \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert(static_builtin_index_get(self) == \
assert(static_builtin_index_get(self) ==

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

interp->types.num_builtins_initialized);
}
Expand Down