Kaydet (Commit) 9b955de7 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

use the more direct API

üst 9b4e27e8
...@@ -1190,7 +1190,7 @@ property_descr_get(PyObject *self, PyObject *obj, PyObject *type) ...@@ -1190,7 +1190,7 @@ property_descr_get(PyObject *self, PyObject *obj, PyObject *type)
PyErr_SetString(PyExc_AttributeError, "unreadable attribute"); PyErr_SetString(PyExc_AttributeError, "unreadable attribute");
return NULL; return NULL;
} }
return PyObject_CallFunction(gs->prop_get, "(O)", obj); return PyObject_CallFunctionObjArgs(gs->prop_get, obj, NULL);
} }
static int static int
...@@ -1211,9 +1211,9 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value) ...@@ -1211,9 +1211,9 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
return -1; return -1;
} }
if (value == NULL) if (value == NULL)
res = PyObject_CallFunction(func, "(O)", obj); res = PyObject_CallFunctionObjArgs(func, obj, NULL);
else else
res = PyObject_CallFunction(func, "(OO)", obj, value); res = PyObject_CallFunctionObjArgs(func, obj, value, NULL);
if (res == NULL) if (res == NULL)
return -1; return -1;
Py_DECREF(res); Py_DECREF(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment