Skip to content

Commit

Permalink
restore the singular decref. (correctness)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Jun 4, 2023
1 parent 996e70b commit 517bd0d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,7 @@ property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset,
}
int err = PyObject_SetAttr(
(PyObject *)self, &_Py_ID(__doc__), prop_doc);
Py_DECREF(prop_doc);
if (err < 0) {
assert(PyErr_Occurred());
if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
Expand All @@ -1842,10 +1843,8 @@ property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset,
// If we ever want to deprecate this behavior, only raise a
// warning or error when proc_doc is not None so that
// property without a specific doc= still works.
Py_DECREF(prop_doc);
return 0;
} else {
Py_DECREF(prop_doc);
return -1;
}
}
Expand Down

0 comments on commit 517bd0d

Please sign in to comment.