Kaydet (Commit) e69a08ea authored tarafından Christian Heimes's avatar Christian Heimes

Fix for bug #1442 pythonstartup addition of minor error checking

Python failed to report an error when it wasn't able to open the PYTHONSTARTUP file.
üst 9a68f8c3
......@@ -132,6 +132,16 @@ 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();
}
}
}
......
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