From 81a0c11ecb84bcb7dcd4c928c1f82e47fbd2e130 Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Tue, 29 Mar 2005 13:36:16 +0000 Subject: Move exception finalisation later in the shutdown process - this fixes the crash seen in bug #1165761 --- Python/pythonrun.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 6d691655cc..f629709af8 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -392,13 +392,6 @@ Py_Finalize(void) _Py_PrintReferences(stderr); #endif /* Py_TRACE_REFS */ - /* Now we decref the exception classes. After this point nothing - can raise an exception. That's okay, because each Fini() method - below has been checked to make sure no exceptions are ever - raised. - */ - _PyExc_Fini(); - /* Cleanup auto-thread-state */ #ifdef WITH_THREAD _PyGILState_Fini(); @@ -407,6 +400,14 @@ Py_Finalize(void) /* Clear interpreter state */ PyInterpreterState_Clear(interp); + /* Now we decref the exception classes. After this point nothing + can raise an exception. That's okay, because each Fini() method + below has been checked to make sure no exceptions are ever + raised. + */ + + _PyExc_Fini(); + /* Delete current thread */ PyThreadState_Swap(NULL); PyInterpreterState_Delete(interp); -- cgit v1.2.1