Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 13, 2024
1 parent 08267d5 commit dacc60f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6178,7 +6178,10 @@ def visit_await_expr(self, expr: AwaitExpr) -> None:
# This is not a blocker, because some enviroments (like ipython)
# support top level awaits.
self.fail('"await" outside function', expr, serious=True, code=codes.TOP_LEVEL_AWAIT)
elif not self.function_stack[-1].is_coroutine and self.scope_stack[-1] != SCOPE_COMPREHENSION:
elif (
not self.function_stack[-1].is_coroutine
and self.scope_stack[-1] != SCOPE_COMPREHENSION
):
self.fail(
'"await" outside coroutine ("async def")',
expr,
Expand Down

0 comments on commit dacc60f

Please sign in to comment.