8000 gh-98963: Restore the ability to have a dict-less property. by gpshead · Pull Request #105262 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98963: Restore the ability to have a dict-less property. #105262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
restore the singular decref. (correctness)
  • Loading branch information
gpshead committed Jun 4, 2023
commit 517bd0dec879c86f4914f6e5778cc53cae778a60
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