From: Thomas Wouters Date: Sun, 13 Aug 2000 17:05:17 +0000 (+0000) Subject: The list comp patch checked for the second child node of the 'listmaker' X-Git-Tag: v2.0b1~475 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87df80d542b5bc0adeca2c864b6db19afe7f64aa;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Python/compile.c b/Python/compile.c index adefb4fbbabe..476f1f20bfa0 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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;