mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Move the call to _Py_PrintReferences() a bit further down. This
prevents it from showing stuff (like codec state) that is cleared when the interpreter state is cleared.
This commit is contained in:
parent
28e83e3a66
commit
d922fa46ce
1 changed files with 12 additions and 7 deletions
|
@ -270,12 +270,6 @@ Py_Finalize(void)
|
||||||
fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
|
fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Py_TRACE_REFS
|
|
||||||
if (Py_GETENV("PYTHONDUMPREFS")) {
|
|
||||||
_Py_PrintReferences(stderr);
|
|
||||||
}
|
|
||||||
#endif /* Py_TRACE_REFS */
|
|
||||||
|
|
||||||
/* Now we decref the exception classes. After this point nothing
|
/* Now we decref the exception classes. After this point nothing
|
||||||
can raise an exception. That's okay, because each Fini() method
|
can raise an exception. That's okay, because each Fini() method
|
||||||
below has been checked to make sure no exceptions are ever
|
below has been checked to make sure no exceptions are ever
|
||||||
|
@ -283,11 +277,22 @@ Py_Finalize(void)
|
||||||
*/
|
*/
|
||||||
_PyExc_Fini();
|
_PyExc_Fini();
|
||||||
|
|
||||||
/* Delete current thread */
|
/* Clear interpreter state */
|
||||||
PyInterpreterState_Clear(interp);
|
PyInterpreterState_Clear(interp);
|
||||||
|
|
||||||
|
#ifdef Py_TRACE_REFS
|
||||||
|
/* Dump references -- this may implicitly need the thread state,
|
||||||
|
so this is the last possible place where we can do this. */
|
||||||
|
if (Py_GETENV("PYTHONDUMPREFS")) {
|
||||||
|
_Py_PrintReferences(stderr);
|
||||||
|
}
|
||||||
|
#endif /* Py_TRACE_REFS */
|
||||||
|
|
||||||
|
/* Delete current thread */
|
||||||
PyThreadState_Swap(NULL);
|
PyThreadState_Swap(NULL);
|
||||||
PyInterpreterState_Delete(interp);
|
PyInterpreterState_Delete(interp);
|
||||||
|
|
||||||
|
/* Sundry finalizers */
|
||||||
PyMethod_Fini();
|
PyMethod_Fini();
|
||||||
PyFrame_Fini();
|
PyFrame_Fini();
|
||||||
PyCFunction_Fini();
|
PyCFunction_Fini();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue