From e69a08ea933e69262b08dc18bb3565892de0ad9b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 14 Nov 2007 16:21:32 +0000 Subject: Fix for bug #1442 pythonstartup addition of minor error checking Python failed to report an error when it wasn't able to open the PYTHONSTARTUP file. --- Modules/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/main.c b/Modules/main.c index ee4a1b8..df4c6d8 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -132,6 +132,16 @@ static void RunStartupFile(PyCompilerFlags *cf) (void) PyRun_SimpleFileExFlags(fp, startup, 0, cf); PyErr_Clear(); fclose(fp); + } else { + int save_errno; + + save_errno = errno; + PySys_WriteStderr("Could not open PYTHONSTARTUP\n"); + errno = save_errno; + PyErr_SetFromErrnoWithFilename(PyExc_IOError, + startup); + PyErr_Print(); + PyErr_Clear(); } } } -- cgit v0.12