Skip to content

Commit 95c5730

Browse files
committed
chore: fail consistently for the new case also on the set comprehension
1 parent 0fee8d6 commit 95c5730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6105,7 +6105,7 @@ def visit_list_comprehension(self, expr: ListComprehension) -> None:
61056105
def visit_set_comprehension(self, expr: SetComprehension) -> None:
61066106
if any(expr.generator.is_async):
61076107
if not self.is_func_scope() or not self.function_stack[-1].is_coroutine:
6108-
self.fail(message_registry.ASYNC_FOR_OUTSIDE_COROUTINE, expr, code=codes.SYNTAX)
6108+
self.fail(message_registry.ASYNC_FOR_OUTSIDE_COROUTINE, expr, code=codes.SYNTAX, serious=True)
61096109

61106110
self._check_await_outside_coroutine(expr)
61116111

0 commit comments

Comments
 (0)