From: Stefan Behnel Date: Tue, 8 Dec 2009 09:45:06 +0000 (+0100) Subject: fix type check condition in double cooercion X-Git-Tag: 0.12.1~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6eca3b4c3a75e76000fd3e6ac49dc61ab674c92;p=cython.git fix type check condition in double cooercion --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index b8380ec2..c15985f9 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1674,7 +1674,7 @@ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { return PyFloat_AsDouble(obj); - } else if (PyUnicode_CheckExact(obj) || PyString_CheckExact(obj)) { + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else