Commit c43b6850 authored by Guido van Rossum's avatar Guido van Rossum

Clarify error message for unexpected keyword parameter.

parent 27e280dc
/*********************************************************** /***********************************************************
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, ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment