|
SyFi
0.3
|
Public Member Functions | |
| bool | operator() (PyObject *v, PyObject *w) const |
Definition at line 4071 of file SyFiPYTHON_wrap.cxx.
| bool std::less< PyObject * >::operator() | ( | PyObject * | v, |
| PyObject * | w | ||
| ) | const [inline] |
Definition at line 4074 of file SyFiPYTHON_wrap.cxx.
References run_all::res, SWIG_PYTHON_THREAD_BEGIN_BLOCK, and SWIG_PYTHON_THREAD_END_BLOCK.
{
bool res;
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false;
/* This may fall into a case of inconsistent
eg. ObjA > ObjX > ObjB
but ObjA < ObjB
*/
if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
{
/* Objects can't be compared, this mostly occurred in Python 3.0 */
/* Compare their ptr directly for a workaround */
res = (v < w);
PyErr_Clear();
}
SWIG_PYTHON_THREAD_END_BLOCK;
return res;
}