Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f827f4

Browse files
committed
Visit the initial test element of the listmaker for a list
comprehension. Fixes bug reported by Tim Peters.
1 parent 1113cfc commit 5f827f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4210,7 +4210,8 @@ symtable_node(struct symtable *st, node *n)
42104210
case listmaker:
42114211
if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_for) {
42124212
symtable_list_comprehension(st, CHILD(n, 1));
4213-
break;
4213+
n = CHILD(n, 0);
4214+
goto loop;
42144215
}
42154216
case atom:
42164217
if (TYPE(n) == atom && TYPE(CHILD(n, 0)) == NAME) {

0 commit comments

Comments
 (0)