summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-08 22:11:32 +0000
committerChristian Heimes <christian@cheimes.de>2007-12-08 22:11:32 +0000
commit93266ab60e6f41addd2896902ad1e148e71b7acd (patch)
treed4f8521406b20623536a11446a521c6a78fdcf32 /Python/ast.c
parent127eb76330d2c056ff7d597051b0428a89084ccd (diff)
downloadcpython-93266ab60e6f41addd2896902ad1e148e71b7acd.tar.gz
Fixed #1573: Improper use of the keyword-only syntax makes the parser crash
>>> def f(*, **kw): ... pass ... python: Python/ast.c:652: handle_keywordonly_args: Assertion 'kwonlyargs != ((void *)0)' failed.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 6ad43dd798..0127281a4d 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -649,8 +649,8 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
arg_ty arg;
int i = start;
int j = 0; /* index for kwdefaults and kwonlyargs */
- assert(kwonlyargs != NULL);
- assert(kwdefaults != NULL);
+ assert((kwonlyargs != NULL && kwdefaults != NULL) ||
+ TYPE(CHILD(n, i)) == DOUBLESTAR);
while (i < NCH(n)) {
ch = CHILD(n, i);
switch (TYPE(ch)) {