]> granicus.if.org Git - python/commitdiff
SF patch #798534: Windows os.popen needlessly gets a reference to tuple ()
authorRaymond Hettinger <python@rcn.com>
Mon, 1 Sep 2003 22:25:41 +0000 (22:25 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 1 Sep 2003 22:25:41 +0000 (22:25 +0000)
(Contributed by Andrew Gaul.)

Fixes a minor leak.

Modules/posixmodule.c

index b8bda3b5e455179e4467f7ea93e37e690c0ad905..40526a465ed330046e237fbbc5933e461b2641bc 100644 (file)
@@ -3615,7 +3615,7 @@ static PyObject *_PyPopenProcs = NULL;
 static PyObject *
 posix_popen(PyObject *self, PyObject *args)
 {
-       PyObject *f, *s;
+       PyObject *f;
        int tm = 0;
 
        char *cmdstring;
@@ -3624,8 +3624,6 @@ posix_popen(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s|si:popen", &cmdstring, &mode, &bufsize))
                return NULL;
 
-       s = PyTuple_New(0);
-
        if (*mode == 'r')
                tm = _O_RDONLY;
        else if (*mode != 'w') {