[Python-checkins] CVS: python/dist/src/Python compile.c,2.122,2.123
Thomas Wouters
python-dev@python.org
Sun, 13 Aug 2000 10:05:20 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory slayer.i.sourceforge.net:/tmp/cvs-serv31079/Python
Modified Files:
compile.c
Log Message:
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.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.122
retrieving revision 2.123
diff -C2 -r2.122 -r2.123
*** compile.c 2000/08/12 22:03:16 2.122
--- compile.c 2000/08/13 17:05:17 2.123
***************
*** 1046,1050 ****
{
/* listmaker: test ( list_iter | (',' test)* [','] ) */
! if (TYPE(CHILD(n, 1)) == list_iter)
com_list_comprehension(c, n);
else {
--- 1046,1050 ----
{
/* listmaker: test ( list_iter | (',' test)* [','] ) */
! if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_iter)
com_list_comprehension(c, n);
else {