]> granicus.if.org Git - python/commitdiff
clarify message when raising TypeError to indicate that float() accepts
authorSkip Montanaro <skip@pobox.com>
Thu, 2 May 2002 13:03:22 +0000 (13:03 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 2 May 2002 13:03:22 +0000 (13:03 +0000)
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;
        }