From: Jeremy Hylton Date: Thu, 25 Jan 2001 20:13:10 +0000 (+0000) Subject: Better error message when non-dictionary received for **kwarg X-Git-Tag: v2.1a2~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0ac40c530aea691ebeee3cb3935e6ab99cd1353;p=python Better error message when non-dictionary received for **kwarg --- diff --git a/Python/getargs.c b/Python/getargs.c index 5a9418380b..aa4a22828d 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -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);