diff options
-rw-r--r-- | Modules/parsermodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 9d624bc..c09cccc 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -1469,11 +1469,12 @@ validate_raise_stmt(tree) { int nch = NCH(tree); int res = (validate_ntype(tree, raise_stmt) - && ((nch == 2) || (nch == 4) || (nch == 6))); + && ((nch == 1) || (nch == 2) || (nch == 4) || (nch == 6))); if (res) { - res = (validate_name(CHILD(tree, 0), "raise") - && validate_test(CHILD(tree, 1))); + res = validate_name(CHILD(tree, 0), "raise"); + if (res && (nch >= 2)) + res = validate_test(CHILD(tree, 1)); if (res && nch > 2) { res = (validate_comma(CHILD(tree, 2)) && validate_test(CHILD(tree, 3))); |