Switch more _Py_IsImmortal(...) assertions to _Py_IsImmortalLoose(...)
The remaining calls to _Py_IsImmortal are in free-threaded-only code,
initialization of core objects, tests, and guards that fall back to
code that works with mortal objects.
(cherry picked from commit
57c471a6880956338549380fc5fb35c986937901)
default:
assert (0);
}
- assert(_Py_IsImmortal(ret));
+ assert(_Py_IsImmortalLoose(ret));
return ret;
}
assert(type->tp_name != NULL);
assert(type->tp_base == &PyTuple_Type);
assert((type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN));
- assert(_Py_IsImmortal(type));
+ assert(_Py_IsImmortalLoose(type));
// Cannot delete a type if it still has subclasses
if (_PyType_HasSubclasses(type)) {
However, this decref would be problematic if the module def were
dynamically allocated, it were the last ref, and this function
were called with an interpreter other than the def's owner. */
- assert(value->def == NULL || _Py_IsImmortal(value->def));
+ assert(value->def == NULL || _Py_IsImmortalLoose(value->def));
Py_XDECREF(value->def->m_base.m_copy);
value->def->m_base.m_copy = NULL;