mirror of
https://github.com/python/cpython.git
synced 2025-07-17 16:25:18 +00:00
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.
This commit is contained in:
parent
da65f60783
commit
bc8734174a
2 changed files with 22 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue