]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19663: Improve error message for defaultdict.
authorRaymond Hettinger <python@rcn.com>
Mon, 20 Jul 2015 07:08:09 +0000 (03:08 -0400)
committerRaymond Hettinger <python@rcn.com>
Mon, 20 Jul 2015 07:08:09 +0000 (03:08 -0400)
Modules/_collectionsmodule.c

index 5080a5b9d9cec71825b2b6f1faed7fbd99871fa9..f8b3783db35ceaad1ce2f9d4dce714e1a85ccbdb 100644 (file)
@@ -1595,7 +1595,7 @@ defdict_init(PyObject *self, PyObject *args, PyObject *kwds)
             newdefault = PyTuple_GET_ITEM(args, 0);
             if (!PyCallable_Check(newdefault) && newdefault != Py_None) {
                 PyErr_SetString(PyExc_TypeError,
-                    "first argument must be callable");
+                    "first argument must be callable or None");
                 return -1;
             }
         }