Patch from Georg Brandl and me for #1493

Remove unbound method objects
This commit is contained in:
Christian Heimes 2007-11-25 09:39:14 +00:00
parent 91c77301bf
commit 4a22b5dee7
19 changed files with 65 additions and 115 deletions

View file

@ -643,8 +643,10 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
static PyObject *
func_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
if (obj == Py_None)
obj = NULL;
if (obj == Py_None || obj == NULL) {
Py_INCREF(func);
return func;
}
return PyMethod_New(func, obj, type);
}