summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-12 00:06:34 (GMT)
committerThomas Wouters <thomas@python.org>2006-04-12 00:06:34 (GMT)
commitbb64e511c82447ce142cab812709cd3b25104ad6 (patch)
tree30b26ffe5e8f70510072733c9314503a036e657d
parent9cb28bea04066b6b47f84662e1db130eda137b09 (diff)
downloadcpython-bb64e511c82447ce142cab812709cd3b25104ad6.zip
cpython-bb64e511c82447ce142cab812709cd3b25104ad6.tar.gz
cpython-bb64e511c82447ce142cab812709cd3b25104ad6.tar.bz2
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.
-rw-r--r--Grammar/Grammar4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 9f66df6..6c497dc 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -131,11 +131,11 @@ argument: test [gen_for] | test '=' test # Really [keyword '='] test
list_iter: list_for | list_if
list_for: 'for' exprlist 'in' testlist_safe [list_iter]
-list_if: 'if' test [list_iter]
+list_if: 'if' old_test [list_iter]
gen_iter: gen_for | gen_if
gen_for: 'for' exprlist 'in' or_test [gen_iter]
-gen_if: 'if' test [gen_iter]
+gen_if: 'if' old_test [gen_iter]
testlist1: test (',' test)*