Visitar URL original
gh-135552: Add tests that check if weakref for tp_subclasses cleared after finalization by sergey-miryanov · Pull Request #136304 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
  • Loading branch information
sergey-miryanov and kumaraditya303 authored Jul 8, 2025
commit 7788e5537014c96d729c73d7982cf208c16deef5
4 changes: 2 additions & 2 deletions Lib/test/test_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,11 +1126,11 @@ def test_something(self):
assert_python_ok("-c", source)

def test_do_not_cleanup_type_subclasses_before_finalization(self):
# https://github.com/python/cpython/issues/135552
# See https://github.com/python/cpython/issues/135552
# If we cleanup weakrefs for tp_subclasses before calling
# the finalizer (__del__) then the line `fail = BaseNode.next.next`
# should fail because we are trying to access a subclass
# atribute. But subclass type cache was not properly invalidated.
# attribute. But subclass type cache was not properly invalidated.
code = """
class BaseNode:
def __del__(self):
Expand Down