#2895: don't crash with bytes as keyword argument names.

This commit is contained in:
Georg Brandl 2008-05-16 17:28:50 +00:00
parent bf82e374ee
commit d8b690f7ae
3 changed files with 11 additions and 1 deletions

View file

@ -1532,7 +1532,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
while (PyDict_Next(keywords, &pos, &key, &value)) {
int match = 0;
char *ks;
if (!PyString_Check(key) && !PyUnicode_Check(key)) {
if (!PyUnicode_Check(key)) {
PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
return cleanreturn(0, freelist);