Issue #477863: Print a warning at shutdown if gc.garbage is not empty.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 233fc16..a7a54ba 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -404,6 +404,9 @@
     while (PyGC_Collect() > 0)
         /* nothing */;
 #endif
+    /* We run this while most interpreter state is still alive, so that
+       debug information can be printed out */
+    _PyGC_Fini();
 
     /* Destroy all modules */
     PyImport_Cleanup();