diff options
Diffstat (limited to 'libshiboken/bindingmanager.cpp')
-rw-r--r-- | libshiboken/bindingmanager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp index 09d6fc962..77a384b5f 100644 --- a/libshiboken/bindingmanager.cpp +++ b/libshiboken/bindingmanager.cpp @@ -108,8 +108,8 @@ static void showWrapperMap(const WrapperMap& wrapperMap) for (iter = wrapperMap.begin(); iter != wrapperMap.end(); ++iter) { fprintf(stderr, "key: %p, value: %p (%s, refcnt: %d)\n", iter->first, iter->second, - iter->second->ob_type->tp_name, - (int) iter->second->ob_refcnt); + Py_TYPE(iter->second)->tp_name, + (int) ((PyObject*)iter->second)->ob_refcnt); } fprintf(stderr, "-------------------------------\n"); } @@ -176,7 +176,7 @@ bool BindingManager::hasWrapper(const void* cptr) void BindingManager::registerWrapper(SbkObject* pyObj, void* cptr) { - SbkObjectType* instanceType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type); + SbkObjectType* instanceType = reinterpret_cast<SbkObjectType*>(Py_TYPE(pyObj)); SbkObjectTypePrivate* d = instanceType->d; if (!d) @@ -197,9 +197,9 @@ void BindingManager::registerWrapper(SbkObject* pyObj, void* cptr) void BindingManager::releaseWrapper(SbkObject* sbkObj) { - SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(sbkObj->ob_type); + SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(Py_TYPE(sbkObj)); SbkObjectTypePrivate* d = sbkType->d; - int numBases = ((d && d->is_multicpp) ? getNumberOfCppBaseClasses(sbkObj->ob_type) : 1); + int numBases = ((d && d->is_multicpp) ? getNumberOfCppBaseClasses(Py_TYPE(sbkObj)) : 1); void** cptrs = reinterpret_cast<SbkObject*>(sbkObj)->d->cptr; for (int i = 0; i < numBases; ++i) { @@ -247,7 +247,7 @@ PyObject* BindingManager::getOverride(const void* cptr, const char* methodName) if (method && PyMethod_Check(method) && reinterpret_cast<PyMethodObject*>(method)->im_self == reinterpret_cast<PyObject*>(wrapper)) { PyObject* defaultMethod; - PyObject* mro = wrapper->ob_type->tp_mro; + PyObject* mro = Py_TYPE(wrapper)->tp_mro; // The first class in the mro (index 0) is the class being checked and it should not be tested. // The last class in the mro (size - 1) is the base Python object class which should not be tested also. |