Kaydet (Commit) db581dfb authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Close SF bug 551673. Backport Skip Montanaro's checkin of 2.112.

Clarifies message when raising TypeError to indicate that float() accepts
strings or numbers.
üst 8520b36a
......@@ -123,7 +123,7 @@ PyFloat_FromString(PyObject *v, char **pend)
#endif
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
"float() needs a string argument");
"float() argument must be a string or a number");
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment