[issue1144] parsermodule validation out of sync with Grammar
David Binger
report at bugs.python.org
Thu Nov 15 19:50:29 CET 2007
David Binger added the comment:
Okay, here is the whole thing with a unittest that exposes the problem.
Index: Lib/test/test_parser.py
===================================================================
--- Lib/test/test_parser.py (revision 58984)
+++ Lib/test/test_parser.py (working copy)
@@ -136,6 +136,7 @@
def test_class_defs(self):
self.check_suite("class foo():pass")
+ self.check_suite("class foo(object):pass")
def test_import_from_statement(self):
self.check_suite("from sys.path import *")
Index: Modules/parsermodule.c
===================================================================
--- Modules/parsermodule.c (revision 58984)
+++ Modules/parsermodule.c (working copy)
@@ -992,7 +992,7 @@
if (res) {
if (nch == 7) {
res = ((validate_lparen(CHILD(tree, 2)) &&
- validate_testlist(CHILD(tree, 3)) &&
+ validate_arglist(CHILD(tree, 3)) &&
validate_rparen(CHILD(tree, 4))));
}
else if (nch == 6) {
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1144>
__________________________________
More information about the Python-bugs-list
mailing list