Skip to content

Commit bc7fa26

Browse files
Verify the per-interpreter type state has been cleared.
1 parent 44edc49 commit bc7fa26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Objects/typeobject.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ _PyTypes_Fini(PyInterpreterState *interp)
279279
if (_Py_IsMainInterpreter(interp)) {
280280
clear_slotdefs();
281281
}
282+
283+
assert(interp->types.num_builtins_initialized == 0);
284+
// All the static builtin types should have been finalized already.
285+
for (size_t i = 0; i < _Py_MAX_STATIC_BUILTIN_TYPES; i++) {
286+
assert(interp->types.builtins[i].type == NULL);
287+
}
282288
}
283289

284290

0 commit comments

Comments
 (0)