]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] Fix 'gather' rules in the python parser generator (GH-22021) (GH-22080)
authorPablo Galindo <Pablogsal@gmail.com>
Thu, 3 Sep 2020 15:35:36 +0000 (16:35 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 15:35:36 +0000 (16:35 +0100)
commit270e2492900275fe2ec93c7982fa175ed132e6b9
tree22ca50b0dc36d8795344ec03e3913ae448fc2fd8
parentbe17295280c89771c80f317da072f6c0d016cc60
[3.9] Fix 'gather' rules in the python parser generator (GH-22021) (GH-22080)

Currently, empty sequences in gather rules make the conditional for
gather rules fail as empty sequences evaluate as "False". We need to
explicitly check for "None" (the failure condition) to avoid false
negatives.
(cherry picked from commit e55a0e9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_peg_generator/test_pegen.py
Tools/peg_generator/pegen/python_generator.py