diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-10-03 18:49:42 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:08 -0300 |
commit | 1e29ab65924166688e352eaaa099ad571a980c4f (patch) | |
tree | 2a7ae3cb38b33a3211c9cec0da70016dd5d44c1d /libpyside/globalreceiver.cpp | |
parent | a2cb6fe0254a122f0ad9d2ee991d9a249903ee12 (diff) |
Initia QtCore port to python3.
Diffstat (limited to 'libpyside/globalreceiver.cpp')
-rw-r--r-- | libpyside/globalreceiver.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp index 17f0090f7..05d5e4d38 100644 --- a/libpyside/globalreceiver.cpp +++ b/libpyside/globalreceiver.cpp @@ -75,7 +75,12 @@ DynamicSlotData::DynamicSlotData(int id, PyObject* callback, GlobalReceiver* par //Can not store calback pointe because this will be destroyed at the end of the scope //To avoid increment intance reference keep the callback information m_callback = PyMethod_GET_FUNCTION(callback); +#ifdef IS_PY3K + m_pyClass = 0; +#else m_pyClass = PyMethod_GET_CLASS(callback); +#endif + m_pythonSelf = PyMethod_GET_SELF(callback); //monitor class from method lifetime @@ -92,7 +97,11 @@ PyObject* DynamicSlotData::call(PyObject* args) //create a callback based on method data if (m_isMethod) +#ifdef IS_PY3K + callback = PyMethod_New(callback, m_pythonSelf); +#else callback = PyMethod_New(callback, m_pythonSelf, m_pyClass); +#endif PyObject* result = PyObject_CallObject(callback, args); |