[Python-checkins] cpython (2.7): Issue #19663: Improve error message for defaultdict.

raymond.hettinger python-checkins at python.org
Mon Jul 20 09:14:22 CEST 2015


https://hg.python.org/cpython/rev/d248702feab0
changeset:   96959:d248702feab0
branch:      2.7
parent:      96953:949ba97beece
user:        Raymond Hettinger <python at rcn.com>
date:        Mon Jul 20 03:08:09 2015 -0400
summary:
  Issue #19663: Improve error message for defaultdict.

files:
  Modules/_collectionsmodule.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1595,7 +1595,7 @@
             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;
             }
         }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list