diff options
author | Kirill Podoprigora <kirill.bast9@mail.ru> | 2024-07-15 19:25:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 19:25:54 (GMT) |
commit | c4daec4319bcd58032043dec8a6cd497263077f8 (patch) | |
tree | a3c904c6ef3faafe56c4ab16b7a0f576e80fa412 /Python/compile.c | |
parent | f19ccfdae04f8369255dd64f49fac6a541a18a9a (diff) | |
download | cpython-c4daec4319bcd58032043dec8a6cd497263077f8.zip cpython-c4daec4319bcd58032043dec8a6cd497263077f8.tar.gz cpython-c4daec4319bcd58032043dec8a6cd497263077f8.tar.bz2 |
[3.13] gh-121657: Display correct error message for yield from outsid… (GH-121768)
(cherry picked from commit 178e44de8f023be7a5dc400044ab61983b191f24)
Co-authored-by: Gregor <36135323+gege-hoho@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index 98daa72..7456668 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -6234,7 +6234,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) break; case YieldFrom_kind: if (!_PyST_IsFunctionLike(c->u->u_ste)) { - 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"); |