diff options
author | Thomas Wouters <thomas@python.org> | 2000-08-13 17:05:17 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-08-13 17:05:17 (GMT) |
commit | 87df80d542b5bc0adeca2c864b6db19afe7f64aa (patch) | |
tree | 2a34c54bc90e5b92fbd73619ba6d6e260ab9cdda /Python/compile.c | |
parent | dcb45c34f59d7f35f27364eb66cafd94eb31e30e (diff) | |
download | cpython-87df80d542b5bc0adeca2c864b6db19afe7f64aa.zip cpython-87df80d542b5bc0adeca2c864b6db19afe7f64aa.tar.gz cpython-87df80d542b5bc0adeca2c864b6db19afe7f64aa.tar.bz2 |
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index adefb4f..476f1f2 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; |