From: Tim Peters Date: Fri, 9 Nov 2001 19:23:47 +0000 (+0000) Subject: open_the_file(): this routine has a borrowed reference to the file X-Git-Tag: v2.2.1c1~809 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=114486701aa1c4bc870a82c531aecf80442a83a6;p=thirdparty%2FPython%2Fcpython.git open_the_file(): this routine has a borrowed reference to the file 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). --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 9284185be637..b4f9e9b5c68e 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -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