Backport #1442: report exception when startup file cannot be run.
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 @@
(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();
}
}
}