Skip to content
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

Avoid refcycles in run exc #3120

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

graingert
Copy link
Member

No description provided.

Copy link

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.82640%. Comparing base (a670d60) to head (7c0fb4c).

Additional details and impacted files
@@                 Coverage Diff                  @@
##                 main       #3120         +/-   ##
====================================================
- Coverage   100.00000%   99.82640%   -0.17360%     
====================================================
  Files             124         124                 
  Lines           18427       18433          +6     
  Branches         1215        1215                 
====================================================
- Hits            18427       18401         -26     
- Misses              0          31         +31     
- Partials            0           1          +1     
Files with missing lines Coverage Δ
src/trio/_core/_run.py 99.80488% <100.00000%> (-0.19513%) ⬇️

... and 2 files with indirect coverage changes

@graingert graingert force-pushed the avoid-refcycles-in-run-exc branch from 0d79042 to 12e8395 Compare October 27, 2024 09:50
@@ -1706,6 +1706,7 @@ def close(self) -> None:
self.asyncgens.close()
if "after_run" in self.instruments:
self.instruments.call("after_run")
self.system_nursery: Nursery | None = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type hint here isn't necessary

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as this isn't the first time system_nursery is set yes

demo.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you accidentally left this instead of copying parts over as a test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sorry I pushed this in draft so I don't lose it

@graingert
Copy link
Member Author

I'm currently trying to work out if this change makes it possible to test

# TODO: develop test for this deletion

src/trio/_core/_run.py Outdated Show resolved Hide resolved
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.

3 participants