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:
Miss Islington (bot) 2020-06-07 18:08:53 -07:00 committed by GitHub
parent 71f501698d
commit 6440911736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -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):