Skip to content
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