From cdf0d75897ddde0b27bad24aac4845824578f5ee Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 17 Aug 2001 12:07:34 +0000 Subject: Instance methods: allow a NULL value for im_class. --- Objects/classobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/classobject.c b/Objects/classobject.c index 82eb1d5..b4944f3 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1973,7 +1973,7 @@ PyMethod_New(PyObject *func, PyObject *self, PyObject *class) im->im_func = func; Py_XINCREF(self); im->im_self = self; - Py_INCREF(class); + Py_XINCREF(class); im->im_class = class; PyObject_GC_Init(im); return (PyObject *)im; @@ -2040,7 +2040,7 @@ instancemethod_dealloc(register PyMethodObject *im) PyObject_GC_Fini(im); Py_DECREF(im->im_func); Py_XDECREF(im->im_self); - Py_DECREF(im->im_class); + Py_XDECREF(im->im_class); im->im_self = (PyObject *)free_list; free_list = im; } -- cgit v0.12