mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
clarify message when raising TypeError to indicate that float() accepts
strings or numbers
This commit is contained in:
parent
c6a7d7ef49
commit
71390a9a94
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue