Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (revision 47222) +++ Python/pythonrun.c (working copy) @@ -54,7 +54,6 @@ PyCompilerFlags *); static void err_input(perrdetail *); static void initsigs(void); -static void call_sys_exitfunc(void); static void call_ll_exitfuncs(void); extern void _PyUnicode_Init(void); extern void _PyUnicode_Fini(void); @@ -342,7 +341,6 @@ * threads created thru it, so this also protects pending imports in * the threads created via Threading. */ - call_sys_exitfunc(); initialized = 0; /* Get current thread state and interpreter pointer */ @@ -1523,29 +1521,6 @@ } static void -call_sys_exitfunc(void) -{ - PyObject *exitfunc = PySys_GetObject("exitfunc"); - - if (exitfunc) { - PyObject *res; - Py_INCREF(exitfunc); - PySys_SetObject("exitfunc", (PyObject *)NULL); - res = PyEval_CallObject(exitfunc, (PyObject *)NULL); - if (res == NULL) { - if (!PyErr_ExceptionMatches(PyExc_SystemExit)) { - PySys_WriteStderr("Error in sys.exitfunc:\n"); - } - PyErr_Print(); - } - Py_DECREF(exitfunc); - } - - if (Py_FlushLine()) - PyErr_Clear(); -} - -static void call_ll_exitfuncs(void) { while (nexitfuncs > 0) Index: Python/import.c =================================================================== --- Python/import.c (revision 47222) +++ Python/import.c (working copy) @@ -338,7 +338,7 @@ /* List of names to clear in sys */ static char* sys_deletes[] = { - "path", "argv", "ps1", "ps2", "exitfunc", + "path", "argv", "ps1", "ps2", "exc_type", "exc_value", "exc_traceback", "last_type", "last_value", "last_traceback", "path_hooks", "path_importer_cache", "meta_path", Index: Python/sysmodule.c =================================================================== --- Python/sysmodule.c (revision 47222) +++ Python/sysmodule.c (working copy) @@ -856,9 +856,6 @@ To customize printing in an interactive session or to install a custom\n\ top-level exception handler, assign other functions to replace these.\n\ \n\ -exitfunc -- if sys.exitfunc exists, this routine is called when Python exits\n\ - Assigning to sys.exitfunc is deprecated; use the atexit module instead.\n\ -\n\ stdin -- standard input file object; used by raw_input() and input()\n\ stdout -- standard output file object; used by the print statement\n\ stderr -- standard error object; used for error messages\n\ Index: Doc/lib/libsys.tex =================================================================== --- Doc/lib/libsys.tex (revision 47222) +++ Doc/lib/libsys.tex (working copy) @@ -201,19 +201,6 @@ program when an error occurs. \end{funcdesc} -\begin{datadesc}{exitfunc} - This value is not actually defined by the module, but can be set by - the user (or by a program) to specify a clean-up action at program - exit. When set, it should be a parameterless function. This - function will be called when the interpreter exits. Only one - function may be installed in this way; to allow multiple functions - which will be called at termination, use the \refmodule{atexit} - module. \note{The exit function is not called when the program is - killed by a signal, when a Python fatal internal error is detected, - or when \code{os._exit()} is called.} - \deprecated{2.4}{Use \refmodule{atexit} instead.} -\end{datadesc} - \begin{funcdesc}{getcheckinterval}{} Return the interpreter's ``check interval''; see \function{setcheckinterval()}.