Return a NotImplemented exception when comparing Matrix or Vector with other types
This commit is contained in:
parent
f38e6da3c7
commit
f22fc55363
|
@ -159,8 +159,9 @@ PyObject* MatrixPy::richCompare(PyObject *v, PyObject *w, int op)
|
|||
}
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Cannot compare Matrix with other type");
|
||||
return 0;
|
||||
// This always returns False
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -237,8 +237,9 @@ PyObject* VectorPy::richCompare(PyObject *v, PyObject *w, int op)
|
|||
}
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Cannot compare Matrix with other type");
|
||||
return 0;
|
||||
// This always returns False
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user