Skip to content

Commit bb64e51

Browse files
committed
Fix SF bug #1466641: multiple adjacent 'if's in listcomps and genexps, as in
[x for x in it if x if x], were broken for no good reason by the PEP 308 patch.
1 parent 9cb28be commit bb64e51

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Grammar/Grammar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ argument: test [gen_for] | test '=' test # Really [keyword '='] test
131131

132132
list_iter: list_for | list_if
133133
list_for: 'for' exprlist 'in' testlist_safe [list_iter]
134-
list_if: 'if' test [list_iter]
134+
list_if: 'if' old_test [list_iter]
135135

136136
gen_iter: gen_for | gen_if
137137
gen_for: 'for' exprlist 'in' or_test [gen_iter]
138-
gen_if: 'if' test [gen_iter]
138+
gen_if: 'if' old_test [gen_iter]
139139

140140
testlist1: test (',' test)*
141141

0 commit comments

Comments
 (0)