]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed #1573: Improper use of the keyword-only syntax makes the parser crash
authorChristian Heimes <christian@cheimes.de>
Sat, 8 Dec 2007 22:11:32 +0000 (22:11 +0000)
committerChristian Heimes <christian@cheimes.de>
Sat, 8 Dec 2007 22:11:32 +0000 (22:11 +0000)
>>> def f(*, **kw):
...   pass
...
python: Python/ast.c:652: handle_keywordonly_args: Assertion 'kwonlyargs
!= ((void *)0)' failed.

Misc/NEWS
Python/ast.c

index b3905c6ac3c26d0c8468e80f16a167c405b08a76..f5ab8689bd20bc02e0a2dfa6ae9690c34c7c9932 100644 (file)
--- 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*
 
index 6ad43dd7987da908b356e54f5dc3d52364d90484..0127281a4db73422df0b90ca34c7b3a308a59439 100644 (file)
@@ -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)) {