Commit 239aba78 authored by Raymond Hettinger's avatar Raymond Hettinger

Issue #19663: Improve error message for defaultdict.

parent 3018cc49
...@@ -1682,7 +1682,7 @@ defdict_init(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -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;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment