bpo-38006: Add unit test for weakref clear bug (GH-16788)

2 files changed