Commit ddde94b7 authored by Stefan Behnel's avatar Stefan Behnel

fix bytes comparison fallback

parent ade78ced
...@@ -6908,12 +6908,13 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq ...@@ -6908,12 +6908,13 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]); return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]);
else else
return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]); return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
} } /* else: fall back to PyObject_RichCompare() below */
} else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
return (equals == Py_NE); return (equals == Py_NE);
} else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
return (equals == Py_NE); return (equals == Py_NE);
} else { }
{
int result; int result;
PyObject* py_result = PyObject_RichCompare(s1, s2, equals); PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
if (!py_result) if (!py_result)
......
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