From: Guido van Rossum Date: Mon, 10 Mar 1997 22:58:23 +0000 (+0000) Subject: Clarify error message for unexpected keyword parameter. X-Git-Tag: v1.5a1~299 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c43b6850544af69c1d489d23c5dbc9cab7aea5e8;p=python Clarify error message for unexpected keyword parameter. --- diff --git a/Python/ceval.c b/Python/ceval.c index 37a41687fb..23fefe4233 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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);