gh-117783: Immortalize objects that use deferred reference counting by colesbury · Pull Request #118112 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was to keep the fields alive, but maybe that's not the best way to address this.
Basically, test_concurrent_futures.test_interpreter_shutdown was failing because a weakref was cleared later than usual, after the module dictionary was partially cleared. I was concerned that the problem might not be limited to that test, but I don't really have evidence for that one way or the other.
I'll get rid of this swapping and make the weakref callback more robust.