commit | b95b56150fc3e7834783b54acdddeaed4fe44e27 | [log] [tgz] |
---|---|---|
author | Ethan Furman <ethan@stoneleaf.us> | Fri Jan 23 20:05:18 2015 -0800 |
committer | Ethan Furman <ethan@stoneleaf.us> | Fri Jan 23 20:05:18 2015 -0800 |
tree | c1994946e84b457841024402b50f8a9640211cb4 | |
parent | 8861502e0746465c4124548681f05969c08f4cae [diff] [blame] |
Issue20284: Implement PEP461
diff --git a/Objects/abstract.c b/Objects/abstract.c index 323c985..9ab60f2 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c
@@ -686,8 +686,9 @@ Py_DECREF(meth); if (result && !PyUnicode_Check(result)) { - PyErr_SetString(PyExc_TypeError, - "__format__ method did not return string"); + PyErr_Format(PyExc_TypeError, + "__format__ must return a str, not %.200s", + Py_TYPE(result)->tp_name); Py_DECREF(result); result = NULL; goto done;