Commit 951cb7d7 authored by Georg Brandl's avatar Georg Brandl

Backport #1442: report exception when startup file cannot be run.

parent 535a5c2a
...@@ -12,6 +12,9 @@ What's New in Python 2.5.3? ...@@ -12,6 +12,9 @@ What's New in Python 2.5.3?
Core and builtins Core and builtins
----------------- -----------------
- Patch #1442: properly report exceptions when the PYTHONSTARTUP file
cannot be executed.
- The compilation of a class nested in another class used to leak one - The compilation of a class nested in another class used to leak one
reference on the outer class name. reference on the outer class name.
...@@ -27,6 +30,7 @@ Core and builtins ...@@ -27,6 +30,7 @@ Core and builtins
- Issue #2238: Some syntax errors in *args and **kwargs expressions could give - Issue #2238: Some syntax errors in *args and **kwargs expressions could give
bogus error messages. bogus error messages.
Library Library
------- -------
...@@ -81,8 +85,9 @@ Build ...@@ -81,8 +85,9 @@ Build
Windows Windows
------- -------
What's New in Python 2.5.2? What's New in Python 2.5.2?
============================= ===========================
*Release date: 21-Feb-2008* *Release date: 21-Feb-2008*
......
...@@ -134,6 +134,15 @@ static void RunStartupFile(PyCompilerFlags *cf) ...@@ -134,6 +134,15 @@ static void RunStartupFile(PyCompilerFlags *cf)
(void) PyRun_SimpleFileExFlags(fp, startup, 0, cf); (void) PyRun_SimpleFileExFlags(fp, startup, 0, cf);
PyErr_Clear(); PyErr_Clear();
fclose(fp); 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();
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment