diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-01-25 20:13:10 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-01-25 20:13:10 (GMT) |
commit | a0ac40c530aea691ebeee3cb3935e6ab99cd1353 (patch) | |
tree | 8e906506eff356f89f8f14f66c5c10884c618ed7 /Python/getargs.c | |
parent | 619eea6821a0c749d2f86d247fa3f7d28d867681 (diff) | |
download | cpython-a0ac40c530aea691ebeee3cb3935e6ab99cd1353.zip cpython-a0ac40c530aea691ebeee3cb3935e6ab99cd1353.tar.gz cpython-a0ac40c530aea691ebeee3cb3935e6ab99cd1353.tar.bz2 |
Better error message when non-dictionary received for **kwarg
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); |