]> granicus.if.org Git - python/commitdiff
Issue #27809: builtin___build_class__() uses fast call
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 22 Aug 2016 23:34:35 +0000 (01:34 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 22 Aug 2016 23:34:35 +0000 (01:34 +0200)
Python/bltinmodule.c

index b22867eb073f420f1b9a1d84e3ff72556612dbd2..00a85b57415ad177e37e8c56cd7d557c665c0a2a 100644 (file)
@@ -169,12 +169,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
                              NULL, 0, NULL, 0, NULL, 0, NULL,
                              PyFunction_GET_CLOSURE(func));
     if (cell != NULL) {
-        PyObject *margs;
-        margs = PyTuple_Pack(3, name, bases, ns);
-        if (margs != NULL) {
-            cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
-            Py_DECREF(margs);
-        }
+        PyObject *margs[3] = {name, bases, ns};
+        cls = _PyObject_FastCallDict(meta, margs, 3, mkw);
         if (cls != NULL && PyCell_Check(cell))
             PyCell_Set(cell, cls);
         Py_DECREF(cell);