]> granicus.if.org Git - python/commitdiff
open_the_file(): this routine has a borrowed reference to the file
authorTim Peters <tim.peters@gmail.com>
Fri, 9 Nov 2001 19:23:47 +0000 (19:23 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 9 Nov 2001 19:23:47 +0000 (19:23 +0000)
object, so the "Metroworks only" section should not decref it in case
of error (the caller is responsible for decref'ing in case of error --
and does).

Objects/fileobject.c

index 9284185be637cb306d1ddafcddc30480dc3236f6..b4f9e9b5c68e27e02f7ed7e135141fd3626db4a3 100644 (file)
@@ -123,7 +123,6 @@ open_the_file(PyFileObject *f, char *name, char *mode)
                /* Metroworks only, not testable, so unchanged */
                if (errno == 0) {
                        PyErr_SetString(PyExc_IOError, "Cannot open file");
-                       Py_DECREF(f);
                        return NULL;
                }
 #endif