summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-22 21:33:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-08-22 21:33:13 (GMT)
commit463b86a881ab9afc4c24f4a669582626977708d7 (patch)
treecf0434ac97f18bbc29973f9883ce10451f0aaa8d /Python
parent155ea65e5c88d250a752ee5321860ef11ede4085 (diff)
downloadcpython-463b86a881ab9afc4c24f4a669582626977708d7.zip
cpython-463b86a881ab9afc4c24f4a669582626977708d7.tar.gz
cpython-463b86a881ab9afc4c24f4a669582626977708d7.tar.bz2
Issue #27809: Use _PyObject_FastCallDict()
Modify: * init_subclass() * builtin___build_class__() Fix also a bug in init_subclass(): check for super() failure.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 1cdc0e2..b22867e 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) {