diff options
author | Gregor <36135323+gege-hoho@users.noreply.github.com> | 2024-07-13 15:14:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-13 15:14:39 (GMT) |
commit | 178e44de8f023be7a5dc400044ab61983b191f24 (patch) | |
tree | d93cf6c5d9d3eb7ab7102a691b5cf313b0bd16c5 /Lib | |
parent | f4d6e45c1e7161878b36ef9e876ca3e44b80a97d (diff) | |
download | cpython-178e44de8f023be7a5dc400044ab61983b191f24.zip cpython-178e44de8f023be7a5dc400044ab61983b191f24.tar.gz cpython-178e44de8f023be7a5dc400044ab61983b191f24.tar.bz2 |
gh-121657: Display correct error message for yield from outside of a function (GH-121680)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_generators.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index daa6571..34f79da 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -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): ... |