mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 16:15:19 -05:00
Respect async with in timeout-without-await (#9859)
Closes https://github.com/astral-sh/ruff/issues/9855.
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user