Commit 95624a28 authored by Stefan Behnel's avatar Stefan Behnel

Make sure that the float() input string is "ready" before parsing it.

parent c59a1dc1
......@@ -667,6 +667,8 @@ static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
// Currently not optimised for 1) Py2.7 and 2) Py3 unicode strings with non-ASCII whitespace.
// See __Pyx__PyBytes_AsDouble() below, the same byte buffer copying could be done here.
#if PY_MAJOR_VERSION >= 3
if (unlikely(PyUnicode_READY(obj) == -1))
return (double)-1;
if (likely(PyUnicode_IS_ASCII(obj))) {
const char *s;
Py_ssize_t length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment