Always call PyObject_ClearWeakRefs
This seems to work in Python 2 and be necessary for correctness in Python 3. weakreflist is not set and yet there are weakrefs which need to be cleared. Oddly it's only the weak key dictionary that fails in Python 3 before removing the conditional; using weakref.ref on its own seems fine. PiperOrigin-RevId: 229645639
Loading
Please sign in to comment