diff options
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 5a94183..aa4a228 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); |