remove Py_CmpToRich (copy of py3.0 function), instead only support == and != for PyRNA and KX_PySequence types.
mesh1 > mesh2 # will raise an error.
This commit is contained in:
@@ -2016,44 +2016,3 @@ void resetGamePythonPath()
|
||||
{
|
||||
gp_GamePythonPathOrig[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
/* Copied from pythons 3's Object.c
|
||||
* also in blenders bpy_uitl.c, mailed the python-dev
|
||||
* list about enabling something like this again for py3 */
|
||||
PyObject *
|
||||
Py_CmpToRich(int op, int cmp)
|
||||
{
|
||||
PyObject *res;
|
||||
int ok;
|
||||
|
||||
if (PyErr_Occurred())
|
||||
return NULL;
|
||||
switch (op) {
|
||||
case Py_LT:
|
||||
ok = cmp < 0;
|
||||
break;
|
||||
case Py_LE:
|
||||
ok = cmp <= 0;
|
||||
break;
|
||||
case Py_EQ:
|
||||
ok = cmp == 0;
|
||||
break;
|
||||
case Py_NE:
|
||||
ok = cmp != 0;
|
||||
break;
|
||||
case Py_GT:
|
||||
ok = cmp > 0;
|
||||
break;
|
||||
case Py_GE:
|
||||
ok = cmp >= 0;
|
||||
break;
|
||||
default:
|
||||
PyErr_BadArgument();
|
||||
return NULL;
|
||||
}
|
||||
res = ok ? Py_True : Py_False;
|
||||
Py_INCREF(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user