summaryrefslogtreecommitdiffstats
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>2011-10-28 15:22:20 -0200
commit82ea7fe5a9020f6ac47695c0f0f3e384db4ef617 (patch)
tree5f3baf51f6e02dd3a3f8bb37d639f81753aeef48 /libshiboken
parent3a774ef95e9d39576d0e56a2c71dac7a26cc1948 (diff)
downloadshiboken-82ea7fe5a9020f6ac47695c0f0f3e384db4ef617.tar.gz
shiboken-82ea7fe5a9020f6ac47695c0f0f3e384db4ef617.tar.xz
shiboken-82ea7fe5a9020f6ac47695c0f0f3e384db4ef617.zip
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 e65cbd7a..554618db 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[] = {