From: Neal Norwitz Date: Sat, 4 Nov 2006 19:25:22 +0000 (+0000) Subject: Bug #1588287: fix invalid assertion for `1,2` in debug builds. X-Git-Tag: v2.6a1~2465 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85dbec6da74d4e5e83d0ff9c03155ecef8feea83;p=thirdparty%2FPython%2Fcpython.git Bug #1588287: fix invalid assertion for `1,2` in debug builds. Will backport --- diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 69e198015841..14ce7e49a812 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -747,6 +747,8 @@ hello world x = `x` x = `1 or 2 or 3` + self.assertEqual(`1,2`, '(1, 2)') + x = x x = 'x' x = 123 diff --git a/Misc/NEWS b/Misc/NEWS index 2ed93714e6ab..0527d830c914 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 2.6 alpha 1? 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 f49026807f6f..dcf7f2b3ab08 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -532,6 +532,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);