Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12b6f6c

Browse files
committed
Move exception finalisation later in the shutdown process - this
fixes the crash seen in bug #1165761
1 parent b7e99b6 commit 12b6f6c

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ Python News
77
What's New in Python 2.5 alpha 1?
88
=================================
99

10+
*Release date: XX-XXX-2006*
11+
1012
Core and builtins
1113
-----------------
1214

15+
- Move exception finalisation later in the shutdown process - this
16+
fixes the crash seen in bug #1165761
17+
1318
- Added two new builtins, any() and all().
1419

1520
- Defining a class with empty parentheses is now allowed

Python/pythonrun.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,6 @@ Py_Finalize(void)
392392
_Py_PrintReferences(stderr);
393393
#endif /* Py_TRACE_REFS */
394394

395-
/* Now we decref the exception classes. After this point nothing
396-
can raise an exception. That's okay, because each Fini() method
397-
below has been checked to make sure no exceptions are ever
398-
raised.
399-
*/
400-
_PyExc_Fini();
401-
402395
/* Cleanup auto-thread-state */
403396
#ifdef WITH_THREAD
404397
_PyGILState_Fini();
@@ -407,6 +400,14 @@ Py_Finalize(void)
407400
/* Clear interpreter state */
408401
PyInterpreterState_Clear(interp);
409402

403+
/* Now we decref the exception classes. After this point nothing
404+
can raise an exception. That's okay, because each Fini() method
405+
below has been checked to make sure no exceptions are ever
406+
raised.
407+
*/
408+
409+
_PyExc_Fini();
410+
410411
/* Delete current thread */
411412
PyThreadState_Swap(NULL);
412413
PyInterpreterState_Delete(interp);

0 commit comments

Comments
 (0)