From db581dfb02a3536568f21dae1f1eede3c12ef4e3 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 12 May 2002 17:20:38 +0000 Subject: [PATCH] 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. --- Objects/floatobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 83987baa6b20..5fd13bcc1e83 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -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; } -- 2.47.3