mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Issue#2238: some syntax errors from *args or **kwargs expressions
would give bogus error messages, because of untested exceptions:: >>> f(**g(1=2)) XXX undetected error Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'int' object is not iterable instead of the expected SyntaxError: keyword can't be an expression Will backport.
This commit is contained in:
parent
3710a13506
commit
d21fb4c2e0
3 changed files with 14 additions and 0 deletions
|
@ -1934,10 +1934,14 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
|
|||
}
|
||||
else if (TYPE(ch) == STAR) {
|
||||
vararg = ast_for_expr(c, CHILD(n, i+1));
|
||||
if (!vararg)
|
||||
return NULL;
|
||||
i++;
|
||||
}
|
||||
else if (TYPE(ch) == DOUBLESTAR) {
|
||||
kwarg = ast_for_expr(c, CHILD(n, i+1));
|
||||
if (!kwarg)
|
||||
return NULL;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue