Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c43b685

Browse files
committed
Clarify error message for unexpected keyword parameter.
1 parent 27e280d commit c43b685

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/***********************************************************
23
Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
34
The Netherlands.
@@ -461,7 +462,9 @@ eval_code2(co, globals, locals,
461462
}
462463
if (j >= co->co_argcount) {
463464
if (kwdict == NULL) {
464-
err_setval(TypeError, keyword);
465+
PyErr_Format(TypeError,
466+
"unexpected keyword argument: %.400s",
467+
getstringvalue(keyword));
465468
goto fail;
466469
}
467470
mappinginsert(kwdict, keyword, value);

0 commit comments

Comments
 (0)