From: Guido van Rossum Date: Mon, 19 Aug 1996 22:09:16 +0000 (+0000) Subject: Raise TypeError, not KeyError, on unknown keyword argument. X-Git-Tag: v1.4b3~117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d43c5de5a5958519d620a3cf9bd4efead350e58;p=thirdparty%2FPython%2Fcpython.git Raise TypeError, not KeyError, on unknown keyword argument. --- diff --git a/Python/ceval.c b/Python/ceval.c index 5c812c076b98..5ccccbb2110a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -28,7 +28,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. XXX how to pass arguments to call_trace? XXX totally get rid of access stuff XXX speed up searching for keywords by using a dictionary - XXX unknown keyword shouldn't raise KeyError? XXX document it! */ @@ -449,7 +448,7 @@ eval_code2(co, globals, locals, } if (j >= co->co_argcount) { if (kwdict == NULL) { - err_setval(KeyError/*XXX*/, keyword); + err_setval(TypeError, keyword); goto fail; } mappinginsert(kwdict, keyword, value);