summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-11-04 19:32:54 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-11-04 19:32:54 +0000
commita3ce6aa8b73ef32865c5d42fea61d045e3ce8d4e (patch)
tree131cd346cce0c0a825b5206e82f28e4ae13a2ee0
parent56602a14e63ef610d45a4f443c3b7410453895e8 (diff)
downloadcpython-git-a3ce6aa8b73ef32865c5d42fea61d045e3ce8d4e.tar.gz
Backport 52621:
Bug #1588287: fix invalid assertion for `1,2` in debug builds.
-rw-r--r--Lib/test/test_grammar.py1
-rw-r--r--Misc/NEWS2
-rw-r--r--Python/ast.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index c39e41699e..76483f676a 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -709,6 +709,7 @@ x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
x = `x`
x = `1 or 2 or 3`
+x = `1,2`
x = x
x = 'x'
x = 123
diff --git a/Misc/NEWS b/Misc/NEWS
index 8db0bc40af..9631d4f03f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 2.5.1c1?
Core and builtins
-----------------
+- Bug #1588287: fix invalid assertion for `1,2` in debug builds.
+
- Bug #1576657: when setting a KeyError for a tuple key, make sure that
the tuple isn't used as the "exception arguments tuple".
diff --git a/Python/ast.c b/Python/ast.c
index 52c098ff3b..6551063a7b 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -538,6 +538,7 @@ seq_for_testlist(struct compiling *c, const node *n)
|| TYPE(n) == listmaker
|| TYPE(n) == testlist_gexp
|| TYPE(n) == testlist_safe
+ || TYPE(n) == testlist1
);
seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);