Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 41229:1f843890a4e6
Remove the deprecated and useless "pend" argument from
PyFloat_FromString. (fixes bug #1650903)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sun, 18 Mar 2007 18:35:15 +0000 |
| parents | 4aee3f672f77 |
| children | 15b810e21fe9 |
line wrap: on
line diff
--- a/Objects/floatobject.c Sun Mar 18 16:10:35 2007 +0000 +++ b/Objects/floatobject.c Sun Mar 18 18:35:15 2007 +0000 @@ -62,24 +62,8 @@ return (PyObject *) op; } -/************************************************************************** -RED_FLAG 22-Sep-2000 tim -PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG, - -1. If v was a regular string, *pend was set to point to its terminating - null byte. That's useless (the caller can find that without any - help from this function!). - -2. If v was a Unicode string, or an object convertible to a character - buffer, *pend was set to point into stack trash (the auto temp - vector holding the character buffer). That was downright dangerous. - -Since we can't change the interface of a public API function, pend is -still supported but now *officially* useless: if pend is not NULL, -*pend is set to NULL. -**************************************************************************/ PyObject * -PyFloat_FromString(PyObject *v, char **pend) +PyFloat_FromString(PyObject *v) { const char *s, *last, *end; double x; @@ -89,8 +73,6 @@ #endif Py_ssize_t len; - if (pend) - *pend = NULL; if (PyString_Check(v)) { s = PyString_AS_STRING(v); len = PyString_GET_SIZE(v); @@ -852,7 +834,7 @@ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) return NULL; if (PyString_Check(x)) - return PyFloat_FromString(x, NULL); + return PyFloat_FromString(x); return PyNumber_Float(x); }
