mirror of https://github.com/python/cpython.git
clarify message when raising TypeError to indicate that float() accepts
strings or numbers
This commit is contained in:
parent
c6a7d7ef49
commit
71390a9a94
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue