Marc-Andre Lemburg added the comment: On 16.12.2013 10:30, STINNER Victor wrote: > > STINNER Victor added the comment: > > 2013/12/16 Marc-Andre Lemburg <rep...@bugs.python.org>: >> I don't think changing Py_FatalError() is a good idea. However, >> its use in this particular case (streams not initializing) appears >> wrong. >> >> Python should simply exit with an error code in such a case; which then >> also allows the calling script or application to react to the error. > > Before exiting, you need a message. If there is also an exception, you > may want to display it. If there is no exception, you may want to > display the Python traceback. All these tasks are already implemented > in Py_FatalError. > > If the defaullt behaviour of Py_FatalError() cannot be modified, a new > function should be be added, a function sharing its code with > Py_FatalError(). > > Example: a new private function "void initerror(const char *message)" > only used during Py_Initialize().
Sounds reasonable. BTW: Why can't we make this an official API function, e.g. Py_Terminate() ? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19983> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com