_PyExc_Fini();
- /* Cleanup auto-thread-state */
-#ifdef WITH_THREAD
- _PyGILState_Fini();
-#endif /* WITH_THREAD */
-
/* Sundry finalizers */
PyMethod_Fini();
PyFrame_Fini();
/* Cleanup Unicode implementation */
_PyUnicode_Fini();
- /* Delete current thread. After this, many C API calls become crashy. */
- PyThreadState_Swap(NULL);
- PyInterpreterState_Delete(interp);
-
/* reset file system default encoding */
if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) {
free((char*)Py_FileSystemDefaultEncoding);
PyGrammar_RemoveAccelerators(&_PyParser_Grammar);
+ /* Cleanup auto-thread-state */
+#ifdef WITH_THREAD
+ _PyGILState_Fini();
+#endif /* WITH_THREAD */
+
+ /* Delete current thread. After this, many C API calls become crashy. */
+ PyThreadState_Swap(NULL);
+ PyInterpreterState_Delete(interp);
+
#ifdef Py_TRACE_REFS
/* Display addresses (& refcnts) of all objects still alive.
* An address can be used to find the repr of the object, printed