Mercurial > cpython-lru_cache-weakref
diff Modules/parsermodule.c @ 62655:9f5430e47770 2.6
Merged revisions 82400 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82400 | mark.dickinson | 2010-06-30 17:27:57 +0100 (Wed, 30 Jun 2010) | 2 lines
Issue #9125: Update parser module for "except ... as ..." syntax.
........
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Wed, 30 Jun 2010 16:33:23 +0000 |
| parents | 7f15a6006162 |
| children | 124a76ae7a70 |
line wrap: on
line diff
--- a/Modules/parsermodule.c Tue Jun 29 20:09:50 2010 +0000 +++ b/Modules/parsermodule.c Wed Jun 30 16:33:23 2010 +0000 @@ -2126,10 +2126,13 @@ if (res && (nch > 1)) res = validate_test(CHILD(tree, 1)); - if (res && (nch == 4)) - res = (validate_comma(CHILD(tree, 2)) - && validate_test(CHILD(tree, 3))); - + if (res && (nch == 4)) { + if (TYPE(CHILD(tree, 2)) == NAME) + res = validate_name(CHILD(tree, 2), "as"); + else + res = validate_comma(CHILD(tree, 2)); + res = res && validate_test(CHILD(tree, 3)); + } return (res); }
