aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-10-28 15:22:20 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:24 -0300
commit2a5330b26469914db917c019b97b5966e4f26014 (patch)
tree2e21fcf757cb3efbbc552fe5cc5839eca1ba82ec /libshiboken
parent05aae9a59e9dbc8eec6eb33f86df8de4de71cc67 (diff)
Fix bug 1033 - "QDialog.DialogCode instances and return value from QDialog.exec_ hash to different values"
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/sbkenum.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libshiboken/sbkenum.cpp b/libshiboken/sbkenum.cpp
index e65cbd7a6..554618db6 100644
--- a/libshiboken/sbkenum.cpp
+++ b/libshiboken/sbkenum.cpp
@@ -223,7 +223,10 @@ static PyObject* enum_richcompare(PyObject* self, PyObject* other, int op)
static Py_hash_t enum_hash(PyObject* pyObj)
{
- return PyObject_Hash(reinterpret_cast<SbkEnumObject*>(pyObj)->ob_name);
+ Py_hash_t val = reinterpret_cast<SbkEnumObject*>(pyObj)->ob_value;
+ if (val == -1)
+ val = -2;
+ return val;
}
static PyGetSetDef SbkEnumGetSetList[] = {