diff options
author | Georg Brandl <georg@python.org> | 2008-03-29 01:50:06 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-29 01:50:06 +0000 |
commit | 5087f98a9878dca28b684cbd6f1a6ef01b83d72e (patch) | |
tree | 696989735a36b342431dc0834f4a08e7f4786571 /Modules/main.c | |
parent | 656bc69036b83029401b6bf807876d49b31f114f (diff) | |
download | cpython-5087f98a9878dca28b684cbd6f1a6ef01b83d72e.tar.gz |
Backport #1442: report exception when startup file cannot be run.
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c index 21cb48703d..a919740125 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -140,6 +140,15 @@ 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(); } } } |