avoid error when coro.cr_frame is None#3338
Merged
Zac-HD merged 1 commit intopython-trio:mainfrom Sep 25, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3338 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 125 125
Lines 19586 19597 +11
Branches 1342 1343 +1
===============================================
+ Hits 19586 19597 +11
🚀 New features to boost your workflow:
|
10fcef5 to
8e2561a
Compare
A5rocks
reviewed
Sep 24, 2025
Contributor
A5rocks
left a comment
There was a problem hiding this comment.
Maybe this could be simpler? Makes sense to me.
Maybe @graingert since idk too much about this.
A5rocks
reviewed
Sep 24, 2025
A5rocks
reviewed
Sep 24, 2025
b3e40e6 to
c9e91f7
Compare
c9e91f7 to
26f55f6
Compare
A5rocks
approved these changes
Sep 25, 2025
A5rocks
reviewed
Sep 25, 2025
| # A generator decorated with @types.coroutine | ||
| yield coro.gi_frame, coro.gi_frame.f_lineno | ||
| if gi_frame := coro.gi_frame: # pragma: no branch | ||
| yield gi_frame, gi_frame.f_lineno # pragma: no cover |
Contributor
There was a problem hiding this comment.
I would understand if the # pragma: no branch was for the gi_frame is None case... but then why isn't this covered?
EDIT: adding an assert False, this seems to get run. So I think the no cover isn't necessary.
Suggested change
| yield gi_frame, gi_frame.f_lineno # pragma: no cover | |
| yield gi_frame, gi_frame.f_lineno |
Member
Author
There was a problem hiding this comment.
I think this is just a codecov bug 🤷
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.cr_frameis set toNonewhen a coroutine closes, per python/cpython#112428, and while this rarely comes up in practice you can probably guess why I'm opening a PR.