]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Close stdout and stderr, which are redirected into a temp file, before
authorThomas Heller <theller@ctypes.org>
Wed, 22 Dec 2004 16:49:05 +0000 (16:49 +0000)
committerThomas Heller <theller@ctypes.org>
Wed, 22 Dec 2004 16:49:05 +0000 (16:49 +0000)
trying to remove this file - the file was never removed before.

Fixes [ 1067732 ] wininst --install-script leaves residual files

PC/bdist_wininst/install.c

index f9270194db7f3c5c521042ccc80ca55a023422dc..44a6e0eec8aa26954b7e60018918d54985d9b7a4 100644 (file)
@@ -760,7 +760,9 @@ static int run_simple_script(char *script)
        rc = do_run_simple_script(hPython, script);
        FreeLibrary(hPython);
        fflush(stderr);
+       fclose(stderr);
        fflush(stdout);
+       fclose(stdout);
        /* We only care about the output when we fail.  If the script works
           OK, then we discard it
        */
@@ -1951,7 +1953,9 @@ FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                                fprintf(stderr, "*** Could not load Python ***");
                        }
                        fflush(stderr);
+                       fclose(stderr);
                        fflush(stdout);
+                       fclose(stdout);
            
                        fp = fopen(tempname, "rb");
                        n = fread(buffer, 1, sizeof(buffer), fp);
@@ -2299,7 +2303,9 @@ BOOL Run_RemoveScript(char *line)
                }
        
                fflush(stderr);
+               fclose(stderr);
                fflush(stdout);
+               fclose(stdout);
        
                fp = fopen(tempname, "rb");
                n = fread(buffer, 1, sizeof(buffer), fp);