diff options
author | Raymond Hettinger <python@rcn.com> | 2009-01-06 09:37:13 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-01-06 09:37:13 (GMT) |
commit | 5d1ff00bc03ae5e297a81b3a35ecca8ed3d78d1b (patch) | |
tree | 0008b58608a4c0754a9f747879970a00c6e1deaf /Python | |
parent | 0f6325718a92f78c1ea319908f199bec2fa71ee1 (diff) | |
download | cpython-5d1ff00bc03ae5e297a81b3a35ecca8ed3d78d1b.zip cpython-5d1ff00bc03ae5e297a81b3a35ecca8ed3d78d1b.tar.gz cpython-5d1ff00bc03ae5e297a81b3a35ecca8ed3d78d1b.tar.bz2 |
Mini-optimization: use pack/unpack functions for argument tuples.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c3fefb9..4e9ec85 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -112,7 +112,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) ns = PyDict_New(); } else { - PyObject *pargs = Py_BuildValue("OO", name, bases); + PyObject *pargs = PyTuple_Pack(2, name, bases); if (pargs == NULL) { Py_DECREF(prep); Py_DECREF(meta); @@ -133,7 +133,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) cell = PyObject_CallFunctionObjArgs(func, ns, NULL); if (cell != NULL) { PyObject *margs; - margs = Py_BuildValue("OOO", name, bases, ns); + margs = PyTuple_Pack(3, name, bases, ns); if (margs != NULL) { cls = PyEval_CallObjectWithKeywords(meta, margs, mkw); Py_DECREF(margs); @@ -754,7 +754,7 @@ builtin_exec(PyObject *self, PyObject *args) PyObject *prog, *globals = Py_None, *locals = Py_None; int plain = 0; - if (!PyArg_ParseTuple(args, "O|OO:exec", &prog, &globals, &locals)) + if (!PyArg_UnpackTuple(args, "exec", 1, 3, &prog, &globals, &locals)) return NULL; if (globals == Py_None) { |