Mercurial > cpython-lru_cache-weakref
diff Python/exceptions.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 | 0813b33610cc |
| children | 6641d0542592 |
line wrap: on
line diff
--- a/Python/exceptions.c Sun Oct 12 18:24:34 2003 +0000 +++ b/Python/exceptions.c Sun Oct 12 19:09:37 2003 +0000 @@ -1821,7 +1821,7 @@ } /* Now we need to pre-allocate a MemoryError instance */ - args = Py_BuildValue("()"); + args = PyTuple_New(0); if (!args || !(PyExc_MemoryErrorInst = PyEval_CallObject(PyExc_MemoryError, args))) {
