Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 30683:3b59fa5d25b1 legacy-trunk
Simplify and speedup uses of Py_BuildValue():
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sun, 12 Oct 2003 19:09:37 +0000 |
| parents | 210676ec9d5f |
| children | a29a585b03d9 |
line wrap: on
line diff
--- a/Python/pythonrun.c Sun Oct 12 18:24:34 2003 +0000 +++ b/Python/pythonrun.c Sun Oct 12 19:09:37 2003 +0000 @@ -1037,7 +1037,7 @@ } hook = PySys_GetObject("excepthook"); if (hook) { - PyObject *args = Py_BuildValue("(OOO)", + PyObject *args = PyTuple_Pack(3, exception, v ? v : Py_None, tb ? tb : Py_None); PyObject *result = PyEval_CallObject(hook, args); if (result == NULL) {
