Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1c2a8e

Browse files
committed
Issue #27809: builtin___build_class__() uses fast call
1 parent 6e2333d commit d1c2a8e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Python/bltinmodule.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
169169
NULL, 0, NULL, 0, NULL, 0, NULL,
170170
PyFunction_GET_CLOSURE(func));
171171
if (cell != NULL) {
172-
PyObject *margs;
173-
margs = PyTuple_Pack(3, name, bases, ns);
174-
if (margs != NULL) {
175-
cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
176-
Py_DECREF(margs);
177-
}
172+
PyObject *margs[3] = {name, bases, ns};
173+
cls = _PyObject_FastCallDict(meta, margs, 3, mkw);
178174
if (cls != NULL && PyCell_Check(cell))
179175
PyCell_Set(cell, cls);
180176
Py_DECREF(cell);

0 commit comments

Comments
 (0)