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

index 627fad57539313fe4167ebcc6625fcb1ac4e2c78..65803a4d629f7a81c014c4cbe2653e8e2724e3de 100644 (file)
@@ -1682,7 +1682,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;
             }
         }