From e6f2a2f02b7d9088c885a01b89fc563993fcd43d Mon Sep 17 00:00:00 2001 From: Lauro Neto Date: Thu, 20 Oct 2011 19:42:28 -0300 Subject: Fix regression with enums. Reviewer: Marcelo Lira Reviewer: Hugo Lima --- libshiboken/sbkenum.cpp | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) (limited to 'libshiboken') diff --git a/libshiboken/sbkenum.cpp b/libshiboken/sbkenum.cpp index c372f0b7..e65cbd7a 100644 --- a/libshiboken/sbkenum.cpp +++ b/libshiboken/sbkenum.cpp @@ -192,32 +192,28 @@ static PyObject* enum_richcompare(PyObject* self, PyObject* other, int op) long valA = SBK_ENUM(self)->ob_value; long valB = getNumberValue(other); - if (self == other) { - result = 1; - } else { - switch (op) { - case Py_EQ: - result = (valA == valB); - break; - case Py_NE: - result = (valA != valB); - break; - case Py_LE: - result = (valA <= valB); - break; - case Py_GE: - result = (valA >= valB); - break; - case Py_LT: - result = (valA < valB); - break; - case Py_GT: - result = (valA > valB); - break; - default: - PyErr_BadArgument(); - return NULL; - } + switch (op) { + case Py_EQ: + result = (valA == valB); + break; + case Py_NE: + result = (valA != valB); + break; + case Py_LE: + result = (valA <= valB); + break; + case Py_GE: + result = (valA >= valB); + break; + case Py_LT: + result = (valA < valB); + break; + case Py_GT: + result = (valA > valB); + break; + default: + PyErr_BadArgument(); + return NULL; } if (result) Py_RETURN_TRUE; -- cgit v1.2.3