Clarify error message for unexpected keyword parameter.

This commit is contained in:
Guido van Rossum 1997-03-10 22:58:23 +00:00
parent 27e280dc77
commit c43b685054
1 changed files with 4 additions and 1 deletions

View File

@ -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);