diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2011-10-20 19:42:28 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:18:23 -0300 |
commit | 47c50216cc722fa88fffd14539e101bffb9ebea6 (patch) | |
tree | b4bbb04ea4168d774dd8ca0b71d4e1f27d97e9c5 /libshiboken | |
parent | 84f15f4239715a0cb8c3c61bb3819db5e0285483 (diff) |
Fix regression with enums.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Reviewer: Hugo Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r-- | libshiboken/sbkenum.cpp | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/libshiboken/sbkenum.cpp b/libshiboken/sbkenum.cpp index c372f0b7a..e65cbd7a6 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; |