gh-118331: Don't raise an error if tuple allocation fails when clearing weakrefs (#118338)
It's not safe to raise an exception in `PyObject_ClearWeakRefs()` if one is not already set, since it may be called by `_Py_Dealloc()`, which requires that the active exception does not change. Additionally, make sure we clear the weakrefs even when tuple allocation fails.
M
mpage committed
43fa76638fc75958b592096b6830c15f0afa1a73
Parent: 444ac0b
Committed by GitHub <noreply@github.com>
on 4/29/2024, 4:56:51 PM