[3.13] Update retroactive comments from GH-117741 (segfault in FutureIter_dealloc) (GH-121638) (GH-121642)

Update retroactive comments from GH-117741 (segfault in `FutureIter_dealloc`) (GH-121638)

Address comments
(cherry picked from commit 65fededf9c)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-07-12 11:00:09 +02:00 committed by GitHub
parent 35f7155bc3
commit 15c875a57c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 13 deletions

View file

@ -1602,7 +1602,6 @@ FutureIter_dealloc(futureiterobject *it)
{
PyTypeObject *tp = Py_TYPE(it);
// FutureIter is a heap type so any subclass must also be a heap type.
assert(_PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE));
PyObject *module = ((PyHeapTypeObject*)tp)->ht_module;
@ -1613,8 +1612,6 @@ FutureIter_dealloc(futureiterobject *it)
// GH-115874: We can't use PyType_GetModuleByDef here as the type might have
// already been cleared, which is also why we must check if ht_module != NULL.
// Due to this restriction, subclasses that belong to a different module
// will not be able to use the free list.
if (module && _PyModule_GetDef(module) == &_asynciomodule) {
state = get_asyncio_state(module);
}