File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -6178,9 +6178,7 @@ def visit_await_expr(self, expr: AwaitExpr) -> None:
61786178 # This is not a blocker, because some enviroments (like ipython)
61796179 # support top level awaits.
61806180 self .fail ('"await" outside function' , expr , serious = True , code = codes .TOP_LEVEL_AWAIT )
6181- elif not self .function_stack [- 1 ].is_coroutine and not self .is_in_generator_expression (
6182- expr
6183- ):
6181+ elif not self .function_stack [- 1 ].is_coroutine and self .scope_stack [- 1 ] != SCOPE_COMPREHENSION :
61846182 self .fail (
61856183 '"await" outside coroutine ("async def")' ,
61866184 expr ,
@@ -6189,9 +6187,6 @@ def visit_await_expr(self, expr: AwaitExpr) -> None:
61896187 )
61906188 expr .expr .accept (self )
61916189
6192- def is_in_generator_expression (self , node : AwaitExpr ):
6193- return self .scope_stack [- 1 ] == SCOPE_COMPREHENSION
6194-
61956190 #
61966191 # Patterns
61976192 #
You can’t perform that action at this time.
0 commit comments