From c542bc79c821c9ca3cddd9441698731fa83e2954 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 10 Apr 1998 04:43:28 +0000 Subject: [PATCH] Support raise with no parameters. --- Modules/parsermodule.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 9d624bca894..c09cccc7390 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)));