mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40904: Fix segfault in the new parser with f-string containing yield statements with no value (GH-20701)
(cherry picked from commit 972ab03276
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
71f501698d
commit
6440911736
3 changed files with 7 additions and 0 deletions
|
@ -725,9 +725,11 @@ non-important content
|
|||
# a function into a generator
|
||||
def fn(y):
|
||||
f'y:{yield y*2}'
|
||||
f'{yield}'
|
||||
|
||||
g = fn(4)
|
||||
self.assertEqual(next(g), 8)
|
||||
self.assertEqual(next(g), None)
|
||||
|
||||
def test_yield_send(self):
|
||||
def fn(x):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue