diff Python/ast.c @ 45959:7d2e1ac834b8 2.5

Back-port of rev 61240 for issue #2238, fixing: Some syntax errors in *args and **kwargs expressions could give bogus error messages.
author Sean Reifscheider <jafo@tummy.com>
date Thu, 20 Mar 2008 17:39:31 +0000
parents 8cbe0bd93c28
children 6f6fed4f0626
line wrap: on
line diff
--- a/Python/ast.c	Tue Mar 18 19:24:40 2008 +0000
+++ b/Python/ast.c	Thu Mar 20 17:39:31 2008 +0000
@@ -1878,10 +1878,14 @@
 	}
 	else if (TYPE(ch) == STAR) {
 	    vararg = ast_for_expr(c, CHILD(n, i+1));
+	    if (!vararg)
+	        return NULL;
 	    i++;
 	}
 	else if (TYPE(ch) == DOUBLESTAR) {
 	    kwarg = ast_for_expr(c, CHILD(n, i+1));
+	    if (!kwarg)
+	        return NULL;
 	    i++;
 	}
     }