Kaydet (Commit) a0ac40c5 authored tarafından Jeremy Hylton's avatar Jeremy Hylton

Better error message when non-dictionary received for **kwarg

üst 619eea68
......@@ -1023,8 +1023,13 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
if (keywords) {
if (!PyDict_Check(keywords)) {
PyErr_SetString(PyExc_SystemError,
"non-dictionary object received when keyword dictionary expected");
if (keywords == NULL)
PyErr_SetString(PyExc_SystemError,
"NULL received when keyword dictionary expected");
else
PyErr_Format(PyExc_SystemError,
"%s received when keyword dictionary expected",
keywords->ob_type->tp_name);
return 0;
}
kwlen = PyDict_Size(keywords);
......
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