Commit 71390a9a authored by Skip Montanaro's avatar Skip Montanaro

clarify message when raising TypeError to indicate that float() accepts

strings or numbers
parent c6a7d7ef
...@@ -123,7 +123,7 @@ PyFloat_FromString(PyObject *v, char **pend) ...@@ -123,7 +123,7 @@ PyFloat_FromString(PyObject *v, char **pend)
#endif #endif
else if (PyObject_AsCharBuffer(v, &s, &len)) { else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"float() needs a string argument"); "float() argument must be a string or a number");
return NULL; 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