summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2005-03-29 12:32:50 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2005-03-29 12:32:50 (GMT)
commit4d381b17e4b4a86b52cd5562b005eb29066d2cbd (patch)
tree81f15255b0ee0d4a1362bbb22b0db0a9b85324c0 /Python/pythonrun.c
parentdf0784335c571dc10489cac4d01cc242d73f9014 (diff)
downloadcpython-4d381b17e4b4a86b52cd5562b005eb29066d2cbd.zip
cpython-4d381b17e4b4a86b52cd5562b005eb29066d2cbd.tar.gz
cpython-4d381b17e4b4a86b52cd5562b005eb29066d2cbd.tar.bz2
Move exception finalisation later in the shutdown process - this
fixes the crash seen in bug #1165761
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index e9f4765..50bb20d 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);