mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Fix python comparison operators throwing exceptions
* When used in richcompare this would throw an exception and return Py_NotImplemented causing a failure. Instead we should just return NULL, which is fine and will be considered as a not-equal comparison for equality/inequality and throw the kind of exception we want for less than or greater than.
This commit is contained in:
@@ -22,7 +22,7 @@ PyObject *__lt__(PyObject *other)
|
||||
{
|
||||
int res = SWIG_ConvertPtr(other, &resptr, SWIGTYPE_p_ResourceId, 0);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res), "incorrect comparison type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
id = (ResourceId *)resptr;
|
||||
@@ -129,7 +129,7 @@ PyObject *__eq__(PyObject *other)
|
||||
{
|
||||
int res = SWIG_ConvertPtr(other, &resptr, SWIGTYPE_p_##Class, 0);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res), "incorrect comparison type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
id = (Class *)resptr;
|
||||
@@ -152,7 +152,7 @@ PyObject *__ne__(PyObject *other)
|
||||
{
|
||||
int res = SWIG_ConvertPtr(other, &resptr, SWIGTYPE_p_##Class, 0);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res), "incorrect comparison type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
id = (Class *)resptr;
|
||||
|
||||
Reference in New Issue
Block a user