diff Python/pythonrun.c @ 34834:7cfda9898863 legacy-trunk

Move exception finalisation later in the shutdown process - this fixes the crash seen in bug #1165761
author Anthony Baxter <anthonybaxter@gmail.com>
date Tue, 29 Mar 2005 13:36:16 +0000
parents 3785610ff763
children 1dd8a0d64432
line wrap: on
line diff
--- a/Python/pythonrun.c	Mon Mar 28 23:50:54 2005 +0000
+++ b/Python/pythonrun.c	Tue Mar 29 13:36:16 2005 +0000
@@ -392,13 +392,6 @@
 		_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 @@
 	/* 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);