Issue #19663: Improve error message for defaultdict.
This commit is contained in:
parent
3018cc49e8
commit
239aba7874
|
@ -1682,7 +1682,7 @@ defdict_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
newdefault = PyTuple_GET_ITEM(args, 0);
|
newdefault = PyTuple_GET_ITEM(args, 0);
|
||||||
if (!PyCallable_Check(newdefault) && newdefault != Py_None) {
|
if (!PyCallable_Check(newdefault) && newdefault != Py_None) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
"first argument must be callable");
|
"first argument must be callable or None");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue