8000 Also check Lambda for await-outside-async · pylint-dev/pylint@d43e3c7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d43e3c7

Browse files
committed
Also check Lambda for await-outside-async
1 parent 978981d commit d43e3c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylint/checkers/typecheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ def _check_await_outside_coroutine(self, node: nodes.Await) -> None:
21972197
while not isinstance(node_scope, nodes.Module):
21982198
if isinstance(node_scope, nodes.AsyncFunctionDef):
21992199
return
2200-
if isinstance(node_scope, nodes.FunctionDef):
2200+
if isinstance(node_scope, (nodes.FunctionDef, nodes.Lambda)):
22012201
break
22022202
node_scope = node_scope.parent.scope()
22032203
self.add_message("await-outside-async", node=node)

0 commit comments

Comments
 (0)
0