diff options
author | Georg Brandl <georg@python.org> | 2008-03-29 01:50:46 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-29 01:50:46 (GMT) |
commit | d9f1da0f2202f0af2aa8460fff63f583d3324c51 (patch) | |
tree | b94a373d2f6f0f252cbe6d0abb305c28b8da313a /Modules | |
parent | 8432d86b9f7a6295718544dd5e7c93fd9e3f94e7 (diff) | |
download | cpython-d9f1da0f2202f0af2aa8460fff63f583d3324c51.zip cpython-d9f1da0f2202f0af2aa8460fff63f583d3324c51.tar.gz cpython-d9f1da0f2202f0af2aa8460fff63f583d3324c51.tar.bz2 |
Backport #1442: report exception when startup file cannot be run.
Diffstat (limited to 'Modules')
-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 80c0c04..1700b4e 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -134,6 +134,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(); } } } |