commit | 097cd072c052382d9a85375340b90ab59ce243f7 | [log] [tgz] |
---|---|---|
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | Tue Jul 07 00:43:08 2009 +0000 |
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | Tue Jul 07 00:43:08 2009 +0000 |
tree | 828c079b6ac06ffdc3f80b28e8a22c8c40ccbf13 | |
parent | dd07ebb44a9c5c632d1a8177fcf617b5af1250ec [diff] [blame] |
#6428: py3k requires that __bool__ return a bool (and not an int) Fix the error message and the documentation.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 0e79542..60483e7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c
@@ -4807,10 +4807,8 @@ } else { PyErr_Format(PyExc_TypeError, - "%s should return " - "bool or int, returned %s", - (using_len ? "__len__" - : "__bool__"), + "__bool__ should return " + "bool, returned %s", Py_TYPE(temp)->tp_name); result = -1; }