mirror of https://github.com/python/cpython
Clarify error message for unexpected keyword parameter.
This commit is contained in:
parent
27e280dc77
commit
c43b685054
|
@ -1,3 +1,4 @@
|
|||
|
||||
/***********************************************************
|
||||
Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
|
||||
The Netherlands.
|
||||
|
@ -461,7 +462,9 @@ eval_code2(co, globals, locals,
|
|||
}
|
||||
if (j >= co->co_argcount) {
|
||||
if (kwdict == NULL) {
|
||||
err_setval(TypeError, keyword);
|
||||
PyErr_Format(TypeError,
|
||||
"unexpected keyword argument: %.400s",
|
||||
getstringvalue(keyword));
|
||||
goto fail;
|
||||
}
|
||||
mappinginsert(kwdict, keyword, value);
|
||||
|
|
Loading…
Reference in New Issue