mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-26 05:14:17 +00:00
Respect async with
in timeout-without-await
(#9859)
Closes https://github.com/astral-sh/ruff/issues/9855.
This commit is contained in:
parent
75553ab1c0
commit
daae28efc7
3 changed files with 24 additions and 13 deletions
|
@ -1021,6 +1021,12 @@ impl Visitor<'_> for AwaitVisitor {
|
|||
fn visit_stmt(&mut self, stmt: &Stmt) {
|
||||
match stmt {
|
||||
Stmt::FunctionDef(_) | Stmt::ClassDef(_) => (),
|
||||
Stmt::With(ast::StmtWith { is_async: true, .. }) => {
|
||||
self.seen_await = true;
|
||||
}
|
||||
Stmt::For(ast::StmtFor { is_async: true, .. }) => {
|
||||
self.seen_await = true;
|
||||
}
|
||||
_ => crate::visitor::walk_stmt(self, stmt),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue