Skip to content

Commit

Permalink
Change error message for 'yield from'
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryLHW committed Jul 13, 2024
1 parent dc03ce7 commit 77c5399
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6119,7 +6119,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
break;
case YieldFrom_kind:
if (!_PyST_IsFunctionLike(SYMTABLE_ENTRY(c))) {
return compiler_error(c, loc, "'yield' outside function");
return compiler_error(c, loc, "'yield from' outside function");
}
if (c->u->u_scope_type == COMPILER_SCOPE_ASYNC_FUNCTION) {
return compiler_error(c, loc, "'yield from' inside async function");
Expand Down

0 comments on commit 77c5399

Please sign in to comment.