0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 08:20:55 +01:00

Raise TypeError, not KeyError, on unknown keyword argument.

This commit is contained in:
Guido van Rossum 1996-08-19 22:09:16 +00:00
parent 3f3bb3d3c9
commit 6d43c5de5a

View File

@ -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);