diff --git a/docs/changes.rst b/docs/changes.rst index 6948759..91f699c 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,6 +1,17 @@ Release Notes ============= +Version 1.2.1 +------------- + +**Bugs Fixed** + +* In C implementation, not dealing with unbound method type creation + properly which would cause later problems when calling instance method + via the class type in certain circumstances. Introduced problem in 1.2.0. + +* Eliminated compiler warnings due to missing casts in C implementation. + Version 1.2.0 ------------- diff --git a/src/_wrappers.c b/src/_wrappers.c index ab1e98b..0f4e4ea 100644 --- a/src/_wrappers.c +++ b/src/_wrappers.c @@ -1718,11 +1718,6 @@ static PyObject *WraptFunctionWrapperBase_descr_get( } if (self->parent == Py_None) { - if (!obj) - obj = Py_None; - if (!type) - type = (PyObject *)Py_TYPE(obj); - descriptor = (Py_TYPE(self->object_proxy.wrapped)->tp_descr_get)( self->object_proxy.wrapped, obj, type); @@ -1735,6 +1730,9 @@ static PyObject *WraptFunctionWrapperBase_descr_get( } if (descriptor) { + if (obj == NULL) + obj = Py_None; + result = PyObject_CallFunctionObjArgs(bound_type ? bound_type : (PyObject *)&WraptBoundFunctionWrapper_Type, descriptor, obj, self->wrapper, self->enabled, self->binding, @@ -1768,11 +1766,6 @@ static PyObject *WraptFunctionWrapperBase_descr_get( if (!wrapped) return NULL; - if (!obj) - obj = Py_None; - if (!type) - type = (PyObject *)Py_TYPE(obj); - descriptor = (Py_TYPE(wrapped)->tp_descr_get)(wrapped, obj, type); Py_DECREF(wrapped); @@ -1786,6 +1779,9 @@ static PyObject *WraptFunctionWrapperBase_descr_get( } if (descriptor) { + if (obj == NULL) + obj = Py_None; + result = PyObject_CallFunctionObjArgs(bound_type ? bound_type : (PyObject *)&WraptBoundFunctionWrapper_Type, descriptor, obj, self->wrapper, self->enabled, self->binding,