mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 01:20:40 +00:00
[flake8-async
] allow async generators (ASYNC100
) (#13639)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Treat async generators as "await" in ASYNC100. Fixes #13637 ## Test Plan Updated snapshot
This commit is contained in:
parent
646e4136d7
commit
31ca1c3064
3 changed files with 40 additions and 27 deletions
|
@ -1004,6 +1004,14 @@ impl Visitor<'_> for AwaitVisitor {
|
|||
crate::visitor::walk_expr(self, expr);
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_comprehension(&mut self, comprehension: &'_ crate::Comprehension) {
|
||||
if comprehension.is_async {
|
||||
self.seen_await = true;
|
||||
} else {
|
||||
crate::visitor::walk_comprehension(self, comprehension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Return `true` if a `Stmt` is a docstring.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue