diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-25 09:39:14 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-25 09:39:14 (GMT) |
commit | 4a22b5dee77b6a3439e4a09362586c390bbdef02 (patch) | |
tree | 670472c02e788fe4d027f7967fbbd8253e18cb5f /Objects/funcobject.c | |
parent | 91c77301bf0246deabcdcd80bc7bedb169e2f964 (diff) | |
download | cpython-4a22b5dee77b6a3439e4a09362586c390bbdef02.zip cpython-4a22b5dee77b6a3439e4a09362586c390bbdef02.tar.gz cpython-4a22b5dee77b6a3439e4a09362586c390bbdef02.tar.bz2 |
Patch from Georg Brandl and me for #1493
Remove unbound method objects
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r-- | Objects/funcobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 408be4c..f9b0346 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -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); } |