8000 bpo-44661: Update property_descr_set to use vectorcall if possible. by corona10 · Pull Request #27206 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44661: Update property_descr_set to use vectorcall if possible. #27206 8000

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 3 commits into from
Jul 19, 2021
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
bpo-44661: Follow PEP7
  • Loading branch information
corona10 committed Jul 17, 2021
commit 0b73f89d05e81b51d5f3575a9f989383e1a36e2c
19 changes: 14 additions & 5 deletions Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,33 +1614,42 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
propertyobject *gs = (propertyobject *)self;
PyObject *func, *res;

if (value == NULL)
if (value == NULL) {
func = gs->prop_del;
else
}
else {
func = gs->prop_set;
}

if (func == NULL) {
if (gs->prop_name != NULL) {
PyErr_Format(PyExc_AttributeError,
value == NULL ?
"can't delete attribute %R" :
"can't set attribute %R",
gs->prop_name);
} else {
}
else {
PyErr_SetString(PyExc_AttributeError,
value == NULL ?
"can't delete attribute" :
"can't set attribute");
}
return -1;
}

if (value == NULL) {
res = PyObject_CallOneArg(func, obj);
} else {
}
else {
PyObject *args[] = { obj, value };
res = PyObject_Vectorcall(func, args, 2, NULL);
}
if (res == NULL)

if (res == NULL) {
return -1;
}

Py_DECREF(res);
return 0;
}
Expand Down
0