summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/compile.c2
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;