From: Christian Heimes Date: Sat, 8 Dec 2007 22:11:32 +0000 (+0000) Subject: Fixed #1573: Improper use of the keyword-only syntax makes the parser crash X-Git-Tag: v3.0a3~325 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc8734174a0cd6513e55627464038aed22b3c32c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Misc/NEWS b/Misc/NEWS index b3905c6ac3c2..f5ab8689bd20 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -4,7 +4,27 @@ Python News (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 3.0a3? +=========================== + +*Release data: XX-XXX-2008* + +Core and Builtins +----------------- + +- Issue #1573: Improper use of the keyword-only syntax makes the parser crash + + +Extension Modules +----------------- + + +Library +------- + + What's New in Python 3.0a2? +=========================== *Release date: 07-Dec-2007* diff --git a/Python/ast.c b/Python/ast.c index 6ad43dd7987d..0127281a4db7 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)) {