Commit f2519a59 authored by Guido van Rossum's avatar Guido van Rossum

Raise TypeError, not KeyError, on unknown keyword argument.

parent b0d3d1b2
...@@ -28,7 +28,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -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 how to pass arguments to call_trace?
XXX totally get rid of access stuff XXX totally get rid of access stuff
XXX speed up searching for keywords by using a dictionary XXX speed up searching for keywords by using a dictionary
XXX unknown keyword shouldn't raise KeyError?
XXX document it! XXX document it!
*/ */
...@@ -449,7 +448,7 @@ eval_code2(co, globals, locals, ...@@ -449,7 +448,7 @@ eval_code2(co, globals, locals,
} }
if (j >= co->co_argcount) { if (j >= co->co_argcount) {
if (kwdict == NULL) { if (kwdict == NULL) {
err_setval(KeyError/*XXX*/, keyword); err_setval(TypeError, keyword);
goto fail; goto fail;
} }
mappinginsert(kwdict, keyword, value); mappinginsert(kwdict, keyword, value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment