Re: [Python-Dev] cpython: fixd refleak

On Mon, 10 Jun 2013 10:47:28 +0200 (CEST) christian.heimes <python-checkins@python.org> wrote:
http://hg.python.org/cpython/rev/6860263c05b3 changeset: 84077:6860263c05b3 user: Christian Heimes <christian@cheimes.de> date: Mon Jun 10 10:47:22 2013 +0200 summary: fixd refleak
[...]
- return Py_BuildValue("(OOOO)", ofile_env, ofile, odir_env, odir); + if ((tup = PyTuple_New(4)) == NULL) { + goto error; + } + PyTuple_SET_ITEM(tup, 0, ofile_env); + PyTuple_SET_ITEM(tup, 1, ofile); + PyTuple_SET_ITEM(tup, 2, odir_env); + PyTuple_SET_ITEM(tup, 3, odir); + return tup;
How about return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir); ?

Am 13.06.2013 20:59, schrieb Antoine Pitrou:
How about
return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
?
Oh right, I forgot about 'N'. The PyArg_Parse*() methods don't have it. Do you want me to modify the code to use Py_BuildValue()? Christian

On Thu, 13 Jun 2013 23:39:49 +0200 Christian Heimes <christian@python.org> wrote:
Am 13.06.2013 20:59, schrieb Antoine Pitrou:
How about
return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
?
Oh right, I forgot about 'N'. The PyArg_Parse*() methods don't have it.
Do you want me to modify the code to use Py_BuildValue()?
Always better to use the simple form, IMO. Go for it! Regards Antoine.
participants (2)
-
Antoine Pitrou
-
Christian Heimes