From 2a5330b26469914db917c019b97b5966e4f26014 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Fri, 28 Oct 2011 15:22:20 -0200 Subject: Fix bug 1033 - "QDialog.DialogCode instances and return value from QDialog.exec_ hash to different values" --- libshiboken/sbkenum.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libshiboken') 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(pyObj)->ob_name); + Py_hash_t val = reinterpret_cast(pyObj)->ob_value; + if (val == -1) + val = -2; + return val; } static PyGetSetDef SbkEnumGetSetList[] = { -- cgit v1.2.3