special case Py_None in __Pyx_PyObject_IsTrue()
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 6 Feb 2009 20:20:55 +0000 (18:20 -0200)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 6 Feb 2009 20:20:55 +0000 (18:20 -0200)
Cython/Compiler/PyrexTypes.py

index 145efec4c972e3b777dec85aff975192b8468930..8a024f036f20cba131629e5b3ac43e939eba9b5d 100644 (file)
@@ -1399,6 +1399,7 @@ static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
 static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (x == Py_True) return 1;
    else if (x == Py_False) return 0;
+   else if (x == Py_None) return 0;
    else return PyObject_IsTrue(x);
 }