Skip to content

gh-129280: Avoid cyclic reference in contextlib.contextmanager#129276

Draft
user202729 wants to merge 1 commit intopython:mainfrom
user202729:contextmanager-avoid-cyclic-ref
Draft

gh-129280: Avoid cyclic reference in contextlib.contextmanager#129276
user202729 wants to merge 1 commit intopython:mainfrom
user202729:contextmanager-avoid-cyclic-ref

Conversation

@user202729
Copy link

@user202729 user202729 commented Jan 25, 2025

By deleting the cyclic reference between the frame object and the exception object, this allows the objects to be deleted more quickly (it doesn't need to wait until the next GC cycle)

This also has the practical impact of some packages (cysignals) using reference counting to detect whether the exception has been handled, which breaks in the presence of this situation. sagemath/sage#39142

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants