summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-01-23 01:26:20 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-01-23 01:26:20 (GMT)
commit5f827f4e9b8cd1117c05246abd4ce7971a94c798 (patch)
tree646a16a57dcc6bbe6f52c30b14dc08d0eb005e70 /Python/compile.c
parent1113cfc767e4db1f5dc4a3d223cc0cbb4f9313b8 (diff)
downloadcpython-5f827f4e9b8cd1117c05246abd4ce7971a94c798.zip
cpython-5f827f4e9b8cd1117c05246abd4ce7971a94c798.tar.gz
cpython-5f827f4e9b8cd1117c05246abd4ce7971a94c798.tar.bz2
Visit the initial test element of the listmaker for a list
comprehension. Fixes bug reported by Tim Peters.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index a9ff3df..131f97b 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4210,7 +4210,8 @@ symtable_node(struct symtable *st, node *n)
case listmaker:
if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_for) {
symtable_list_comprehension(st, CHILD(n, 1));
- break;
+ n = CHILD(n, 0);
+ goto loop;
}
case atom:
if (TYPE(n) == atom && TYPE(CHILD(n, 0)) == NAME) {