Skip to content

Commit 4579a55

Browse files
feat: add check for async context managers used with regular with
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent fe26f24 commit 4579a55

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pylint/checkers/typecheck.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,7 @@ def visit_with(self, node: nodes.With) -> None:
19021902
"async-context-manager-with-regular-with",
19031903
node=node,
19041904
args=(inferred.parent.name,),
1905+
confidence=INFERENCE
19051906
)
19061907
continue
19071908
# If the parent of the generator is not the context manager itself,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
async-context-manager-with-regular-with:12:0:13:8::Context manager 'async_cm' is async and should be used with 'async with'.:UNDEFINED
1+
async-context-manager-with-regular-with:12:0:13:8::Context manager 'async_cm' is async and should be used with 'async with'.:INFERENCE

0 commit comments

Comments
 (0)