]> granicus.if.org Git - python/commitdiff
Clarify error message for unexpected keyword parameter.
authorGuido van Rossum <guido@python.org>
Mon, 10 Mar 1997 22:58:23 +0000 (22:58 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 10 Mar 1997 22:58:23 +0000 (22:58 +0000)
Python/ceval.c

index 37a41687fbb5260493c3dc10a36f12cf93d73e1e..23fefe42338d776adfe82e63b79eb26ef5efbce3 100644 (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);