summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-14 16:21:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-14 16:21:32 (GMT)
commite69a08ea933e69262b08dc18bb3565892de0ad9b (patch)
treefec1bb11689fb987366a53e9caeb9f469a93137c
parent9a68f8c3041fbd91f1e1a116d6c773fab3645cf6 (diff)
downloadcpython-e69a08ea933e69262b08dc18bb3565892de0ad9b.zip
cpython-e69a08ea933e69262b08dc18bb3565892de0ad9b.tar.gz
cpython-e69a08ea933e69262b08dc18bb3565892de0ad9b.tar.bz2
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.
-rw-r--r--Modules/main.c10
1 files changed, 10 insertions, 0 deletions
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();
}
}
}