From c43b6850544af69c1d489d23c5dbc9cab7aea5e8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 10 Mar 1997 22:58:23 +0000 Subject: [PATCH] Clarify error message for unexpected keyword parameter. --- Python/ceval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 37a41687fbb..23fefe42338 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);