Skip to content

Commit 79c3129

Browse files
authored
Fix crash when deleting func.__doc__ (python#43)
1 parent 5087885 commit 79c3129

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/funcobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ func_get_doc(PyFunctionObject *op, void *Py_UNUSED(ignored))
521521
static int
522522
func_set_doc(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
523523
{
524-
Py_INCREF(value);
524+
Py_XINCREF(value);
525525
Py_XSETREF(op->func_doc, value);
526526
return 0;
527527
}

0 commit comments

Comments
 (0)