-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix some extra cyclic garbage in NurseryManager #3107
fix some extra cyclic garbage in NurseryManager #3107
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3107 +/- ##
===================================================
+ Coverage 99.58714% 99.58716% +0.00001%
===================================================
Files 121 121
Lines 18166 18167 +1
Branches 3275 3275
===================================================
+ Hits 18091 18092 +1
Misses 52 52
Partials 23 23
|
I'll write a test for this and shape it into a proper PR shortly |
@@ -1023,6 +1023,7 @@ async def __aexit__( | |||
exc: BaseException | None, | |||
tb: TracebackType | None, | |||
) -> bool: | |||
del tb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems intimidating, when you're adding a test could you add another to make sure no stackframes are getting lost? (I assume they're part of exc
in addition?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tb is never needed in a context manager, and cpython are looking to deprecate the three arg form in favor of a one arg exc_value only form
@@ -1043,7 +1044,7 @@ async def __aexit__( | |||
value.__context__ = old_context | |||
# delete references from locals to avoid creating cycles | |||
# see test_cancel_scope_exit_doesnt_create_cyclic_garbage | |||
del _, combined_error_from_nursery, value, new_exc | |||
del _, combined_error_from_nursery, value, new_exc, exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misunderstood this. There's no cycle here because exc.__traceback__
doesn't see this frame
No description provided.