From dacc60ff08351dff04fdcf1c36f944f7a0015bfc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:18:52 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mypy/semanal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mypy/semanal.py b/mypy/semanal.py index de1a36f2c5df..48c05b64f5f3 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -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,