]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Close SF bug 551673. Backport Skip Montanaro's checkin of 2.112.
authorRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 17:20:38 +0000 (17:20 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 17:20:38 +0000 (17:20 +0000)
Clarifies message when raising TypeError to indicate that float() accepts
strings or numbers.

Objects/floatobject.c

index 83987baa6b20cda13e2559def0843d0ce53abfc2..5fd13bcc1e83ddf4f3f42812c3cb14984f9a6ec9 100644 (file)
@@ -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;
        }