mirror of
https://github.com/python/cpython.git
synced 2025-09-25 09:50:37 +00:00
Clarify error message for unexpected keyword parameter.
This commit is contained in:
parent
27e280dc77
commit
c43b685054
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
|
Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
|
||||||
The Netherlands.
|
The Netherlands.
|
||||||
|
@ -461,7 +462,9 @@ eval_code2(co, globals, locals,
|
||||||
}
|
}
|
||||||
if (j >= co->co_argcount) {
|
if (j >= co->co_argcount) {
|
||||||
if (kwdict == NULL) {
|
if (kwdict == NULL) {
|
||||||
err_setval(TypeError, keyword);
|
PyErr_Format(TypeError,
|
||||||
|
"unexpected keyword argument: %.400s",
|
||||||
|
getstringvalue(keyword));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
mappinginsert(kwdict, keyword, value);
|
mappinginsert(kwdict, keyword, value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue