summaryrefslogtreecommitdiffstats
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index d877eda..a570b13 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -183,6 +183,7 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions)
if (func == NULL) {
return -1;
}
+ _PyObject_SetDeferredRefcount(func);
if (PyObject_SetAttrString(module, fdef->ml_name, func) != 0) {
Py_DECREF(func);
return -1;