Commit 5a2c966e authored by Raymond Hettinger's avatar Raymond Hettinger

SF patch #798534: Windows os.popen needlessly gets a reference to tuple ()

(Contributed by Andrew Gaul.)

Fixes a minor leak.
parent c416e17c
...@@ -3615,7 +3615,7 @@ static PyObject *_PyPopenProcs = NULL; ...@@ -3615,7 +3615,7 @@ static PyObject *_PyPopenProcs = NULL;
static PyObject * static PyObject *
posix_popen(PyObject *self, PyObject *args) posix_popen(PyObject *self, PyObject *args)
{ {
PyObject *f, *s; PyObject *f;
int tm = 0; int tm = 0;
char *cmdstring; char *cmdstring;
...@@ -3624,8 +3624,6 @@ posix_popen(PyObject *self, PyObject *args) ...@@ -3624,8 +3624,6 @@ posix_popen(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|si:popen", &cmdstring, &mode, &bufsize)) if (!PyArg_ParseTuple(args, "s|si:popen", &cmdstring, &mode, &bufsize))
return NULL; return NULL;
s = PyTuple_New(0);
if (*mode == 'r') if (*mode == 'r')
tm = _O_RDONLY; tm = _O_RDONLY;
else if (*mode != 'w') { else if (*mode != 'w') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment