summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-06-30 16:33:23 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-06-30 16:33:23 (GMT)
commit9f11f397586b4cc596a9771350daed7f5e8e3e54 (patch)
tree537c34974e3ad8281823fece2bb6828305696eec /Modules
parent284bc0e711debadfaf30c7c18ef51bbe985a78d5 (diff)
downloadcpython-9f11f397586b4cc596a9771350daed7f5e8e3e54.zip
cpython-9f11f397586b4cc596a9771350daed7f5e8e3e54.tar.gz
cpython-9f11f397586b4cc596a9771350daed7f5e8e3e54.tar.bz2
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. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/parsermodule.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 425d97f..365ec90 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -2126,10 +2126,13 @@ validate_except_clause(node *tree)
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);
}