Fix binding issue related to unbound methods.

This commit is contained in:
Graham Dumpleton
2013-10-15 22:06:41 +11:00
parent ed5716f542
commit 87bb6869bf
2 changed files with 17 additions and 10 deletions

View File

@@ -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
-------------

View File

@@ -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,