Skip to content

Commit a459566

Browse files
committed
bpo-44661: Update property_descr_set to use vectorcall if possible.
1 parent f783428 commit a459566

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update property_descr_set to use vectorcall if possible. Patch by Dong-hee
2+
Na.

Objects/descrobject.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,10 +1633,12 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
16331633
}
16341634
return -1;
16351635
}
1636-
if (value == NULL)
1636+
if (value == NULL) {
16371637
res = PyObject_CallOneArg(func, obj);
1638-
else
1639-
res = PyObject_CallFunctionObjArgs(func, obj, value, NULL);
1638+
} else {
1639+
PyObject *args[] = { obj, value };
1640+
res = PyObject_Vectorcall(func, args, 2, NULL);
1641+
}
16401642
if (res == NULL)
16411643
return -1;
16421644
Py_DECREF(res);

0 commit comments

Comments
 (0)