Author: christian.heimes
Date: Wed Nov 14 17:21:32 2007
New Revision: 58969

Modified:
   python/branches/py3k/Modules/main.c
Log:
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.

Modified: python/branches/py3k/Modules/main.c
==============================================================================
--- python/branches/py3k/Modules/main.c (original)
+++ python/branches/py3k/Modules/main.c Wed Nov 14 17:21:32 2007
@@ -132,6 +132,16 @@
                        (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();
                }
        }
 }
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to