Index: Doc/api/init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.23 diff -r1.23 init.tex 39a40,53 > \begin{cfuncdesc}{void}{Py_InitializeFatalHook}{PyFatalHook fp} > Force \cfunction{Py_FatalError()} to invoke the given function > instead of printing to standard error and aborting out of the > process. This is intended for use in embedded applications that > want to define their own route for handling fatal errors. Giving > the application the ability to log the error to a special > destination, and to do any appropriate cleanups before exiting. > > If used, this \emph{must} be called prior to > \cfunction{Py_Initialize()}. Otherwise, \cfunction{Py_Initialize()} > will set the hook to the default, and future attempts to > \cfunction{Py_InitializeFatalHook()} will be ignored. > \end{cfuncdesc} > Index: Include/pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.65 diff -r2.65 pythonrun.h 24a25,27 > typedef void (*PyFatalHook)(const char *); > PyAPI_FUNC(void) Py_InitializeFatalHook(PyFatalHook); > Index: Python/pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.213 diff -r2.213 pythonrun.c 99a100,109 > static PyFatalHook _fatalhook = NULL; > > void > Py_InitializeFatalHook(PyFatalHook f) > { > /* Only set it if it is uninitialized. */ > if (_fatalhook == NULL) > _fatalhook = f; > } > 150a161,162 > Py_InitializeFatalHook(Py_FatalError); > 1507a1520,1523 > if (_fatalhook != Py_FatalError && _fatalhook != NULL) > _fatalhook(msg); > /* If the hook fell through, finish the process anyways. */ >