diff options
author | Raymond Hettinger <python@rcn.com> | 2003-10-12 19:09:37 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-10-12 19:09:37 +0000 |
commit | 8ae468965700fd9900efc28bff8fa2015dae2bef (patch) | |
tree | 1f3545b2d2a3ad8b7d5692a7f84daa88d850b29c /Modules/socketmodule.c | |
parent | cb2da43db8943e9e7b1d900bce1d6416339d6f64 (diff) | |
download | cpython-git-8ae468965700fd9900efc28bff8fa2015dae2bef.tar.gz |
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)
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index a2a692ad8e..4a2fb583e8 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1161,7 +1161,7 @@ sock_accept(PySocketSockObject *s) if (addr == NULL) goto finally; - res = Py_BuildValue("OO", sock, addr); + res = PyTuple_Pack(2, sock, addr); finally: Py_XDECREF(sock); @@ -1911,7 +1911,7 @@ sock_recvfrom(PySocketSockObject *s, PyObject *args) addrlen))) goto finally; - ret = Py_BuildValue("OO", buf, addr); + ret = PyTuple_Pack(2, buf, addr); finally: Py_XDECREF(addr); |