Kaydet (Commit) 25da5beb authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix PR117. The error message is "keywords must be strings". Perhaps

not as descriptive as what Barry suggests, but this also catches the
(in my opinion important) case where some other C code besides apply()
constructs a kwdict that doesn't have the right format.  All the other
possibilities of getting it wrong (non-dict, wrong keywords etc) are
already caught so this makes sense to check here.
üst e1ada505
......@@ -482,6 +482,11 @@ eval_code2(co, globals, locals,
PyObject *keyword = kws[2*i];
PyObject *value = kws[2*i + 1];
int j;
if (keyword == NULL || !PyString_Check(keyword)) {
PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
goto fail;
}
/* XXX slow -- speed up using dictionary? */
for (j = 0; j < co->co_argcount; j++) {
PyObject *nm = PyTuple_GET_ITEM(
......
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