summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-08 22:11:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-08 22:11:32 (GMT)
commitbc8734174a0cd6513e55627464038aed22b3c32c (patch)
tree3d872c8ec94e9a6510ccebbf9381f7c0968debc6 /Python/ast.c
parentda65f6078359a3906366300544eb3692e3c2a0f8 (diff)
downloadcpython-bc8734174a0cd6513e55627464038aed22b3c32c.zip
cpython-bc8734174a0cd6513e55627464038aed22b3c32c.tar.gz
cpython-bc8734174a0cd6513e55627464038aed22b3c32c.tar.bz2
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 6ad43dd..0127281 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)) {