Skip to content

Commit

Permalink
Also check Lambda for await-outside-async
Browse files Browse the repository at this point in the history
  • Loading branch information
UTsweetyfish committed May 19, 2024
1 parent 978981d commit 494375f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ def _check_await_outside_coroutine(self, node: nodes.Await) -> None:
while not isinstance(node_scope, nodes.Module):
if isinstance(node_scope, nodes.AsyncFunctionDef):
return
if isinstance(node_scope, nodes.FunctionDef):
if isinstance(node_scope, nodes.FunctionDef) or isinstance(node_scope, nodes.Lambda):
break
node_scope = node_scope.parent.scope()
self.add_message("await-outside-async", node=node)
Expand Down

0 comments on commit 494375f

Please sign in to comment.