Skip to content

Respect async expressions in comprehension bodies - #11219

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/comp
Apr 30, 2024
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/comp

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

We weren't recursing into the comprehension body.

@charliermarsh charliermarsh added the bug An issue describing something that isn't working, or a PR that fixes a bug label Apr 30, 2024
}
_ => preorder::walk_expr(self, expr),
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(No change to this method, just reordered to match trait definition.)

if comprehension.is_async {
self.found_await_or_async = true;
} else {
preorder::walk_comprehension(self, comprehension);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the fix.

@charliermarsh
charliermarsh marked this pull request as ready for review April 30, 2024 18:31
@charliermarsh
charliermarsh enabled auto-merge (squash) April 30, 2024 18:31
@charliermarsh
charliermarsh merged commit 414990c into main Apr 30, 2024
@charliermarsh
charliermarsh deleted the charlie/comp branch April 30, 2024 18:38
@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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

Labels

bug An issue describing something that isn't working, or a PR that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant