From: Georg Brandl Date: Fri, 26 May 2006 20:22:50 +0000 (+0000) Subject: Simplify calling. X-Git-Tag: v2.5b1~430 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4e023c4d3104cbf144437d25e6906e828a28993;p=python Simplify calling. --- diff --git a/Objects/classobject.c b/Objects/classobject.c index a89366b66c..2fb16ebd0d 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1072,21 +1072,15 @@ static PyMappingMethods instance_as_mapping = { static PyObject * instance_item(PyInstanceObject *inst, Py_ssize_t i) { - PyObject *func, *arg, *res; + PyObject *func, *res; if (getitemstr == NULL) getitemstr = PyString_InternFromString("__getitem__"); func = instance_getattr(inst, getitemstr); if (func == NULL) return NULL; - arg = Py_BuildValue("(n)", i); - if (arg == NULL) { - Py_DECREF(func); - return NULL; - } - res = PyEval_CallObject(func, arg); + res = PyObject_CallFunction(func, "n", i); Py_DECREF(func); - Py_DECREF(arg); return res; }