summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-29 01:50:06 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-29 01:50:06 (GMT)
commit91e0cdaedca473fe5833a0f7d0d2eb40f25383aa (patch)
treea6fd5d4e699bdab5c272df36b4992d5ffc1265a9 /Modules
parent2aece57d7f7c4233c801d10f500a3f8a2ef483f7 (diff)
downloadcpython-91e0cdaedca473fe5833a0f7d0d2eb40f25383aa.zip
cpython-91e0cdaedca473fe5833a0f7d0d2eb40f25383aa.tar.gz
cpython-91e0cdaedca473fe5833a0f7d0d2eb40f25383aa.tar.bz2
Backport #1442: report exception when startup file cannot be run.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 21cb487..a919740 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();
}
}
}