summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-10-20 19:42:28 -0300
committerLauro Neto <lauro.neto@openbossa.org>2011-10-20 19:45:46 -0300
commite6f2a2f02b7d9088c885a01b89fc563993fcd43d (patch)
treebd524a51426a719f9c42fcd82d12b0d633cf7fd8 /libshiboken
parent70e8fa58a898fe65147c73cd6567cf355a4519cf (diff)
downloadshiboken-e6f2a2f02b7d9088c885a01b89fc563993fcd43d.tar.gz
shiboken-e6f2a2f02b7d9088c885a01b89fc563993fcd43d.tar.xz
shiboken-e6f2a2f02b7d9088c885a01b89fc563993fcd43d.zip
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.cpp48
1 files changed, 22 insertions, 26 deletions
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;