mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
[3.13] gh-121657: Display correct error message for yield from outsid… (GH-121768)
(cherry picked from commit 178e44de8f
)
Co-authored-by: Gregor <36135323+gege-hoho@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
f19ccfdae0
commit
c4daec4319
3 changed files with 8 additions and 1 deletions
|
@ -2247,6 +2247,11 @@ Traceback (most recent call last):
|
|||
...
|
||||
SyntaxError: 'yield' outside function
|
||||
|
||||
>>> yield from [1,2]
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: 'yield from' outside function
|
||||
|
||||
>>> def f(): x = yield = y
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue