mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Avoid triggering SIM117 for async with statements
This commit is contained in:
parent
d71a615b18
commit
396be5edea
2 changed files with 14 additions and 2 deletions
|
@ -16,3 +16,15 @@ with A() as a:
|
|||
with B() as b:
|
||||
print("hello")
|
||||
a()
|
||||
|
||||
async with A() as a:
|
||||
with B() as b:
|
||||
print("hello")
|
||||
|
||||
with A() as a:
|
||||
async with B() as b:
|
||||
print("hello")
|
||||
|
||||
async with A() as a:
|
||||
async with B() as b:
|
||||
print("hello")
|
||||
|
|
|
@ -1279,7 +1279,7 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
StmtKind::With { items, body, .. } | StmtKind::AsyncWith { items, body, .. } => {
|
||||
StmtKind::With { items, body, .. } => {
|
||||
if self.settings.enabled.contains(&RuleCode::B017) {
|
||||
flake8_bugbear::rules::assert_raises_exception(self, stmt, items);
|
||||
}
|
||||
|
@ -1291,7 +1291,7 @@ where
|
|||
self,
|
||||
stmt,
|
||||
body,
|
||||
self.current_stmt_parent().map(|parent| parent.0),
|
||||
self.current_stmt_parent().map(Into::into),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue