summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-04-10 04:43:28 (GMT)
committerFred Drake <fdrake@acm.org>1998-04-10 04:43:28 (GMT)
commitc542bc79c821c9ca3cddd9441698731fa83e2954 (patch)
treedeacc13e6b14d68dd62986bd19559d6e23faa70e /Modules
parenta239880a2286505d1c3626f584fb12bfcc2d32e8 (diff)
downloadcpython-c542bc79c821c9ca3cddd9441698731fa83e2954.zip
cpython-c542bc79c821c9ca3cddd9441698731fa83e2954.tar.gz
cpython-c542bc79c821c9ca3cddd9441698731fa83e2954.tar.bz2
Support raise with no parameters.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/parsermodule.c7
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)));