Fix binding issue related to unbound methods.
This commit is contained in:
@@ -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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user