From 463b86a881ab9afc4c24f4a669582626977708d7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 22 Aug 2016 23:33:13 +0200 Subject: Issue #27809: Use _PyObject_FastCallDict() Modify: * init_subclass() * builtin___build_class__() Fix also a bug in init_subclass(): check for super() failure. --- Python/bltinmodule.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 1cdc0e2563..b22867eb07 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -155,16 +155,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) } } else { - PyObject *pargs = PyTuple_Pack(2, name, bases); - if (pargs == NULL) { - Py_DECREF(prep); - Py_DECREF(meta); - Py_XDECREF(mkw); - Py_DECREF(bases); - return NULL; - } - ns = PyEval_CallObjectWithKeywords(prep, pargs, mkw); - Py_DECREF(pargs); + PyObject *pargs[2] = {name, bases}; + ns = _PyObject_FastCallDict(prep, pargs, 2, mkw); Py_DECREF(prep); } if (ns == NULL) { -- cgit v1.2.1