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,