mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
The list comp patch checked for the second child node of the 'listmaker'
node, without checking if the node actually had more than one child. It can have only one node, though: '[' test ']'. This fixes it.
This commit is contained in:
parent
dcb45c34f5
commit
87df80d542
1 changed files with 1 additions and 1 deletions
|
@ -1045,7 +1045,7 @@ static void
|
|||
com_listmaker(struct compiling *c, node *n)
|
||||
{
|
||||
/* listmaker: test ( list_iter | (',' test)* [','] ) */
|
||||
if (TYPE(CHILD(n, 1)) == list_iter)
|
||||
if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_iter)
|
||||
com_list_comprehension(c, n);
|
||||
else {
|
||||
int len = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue