summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
author?ukasz Langa <lukasz@langa.pl>2016-09-09 21:47:46 -0700
committer?ukasz Langa <lukasz@langa.pl>2016-09-09 21:47:46 -0700
commit2286749cb025118308ce513a1b4ba90daa6e968e (patch)
tree161a5c65d706788bb0eaaa114e6dd628726a808b /Python
parentd98cade64e9cf5f885913d770b43661d2f799531 (diff)
downloadcpython-2286749cb025118308ce513a1b4ba90daa6e968e.tar.gz
Don't run garbage collection on interpreter exit if it was explicitly disabled
by the user.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index f93afd234d..5b5cc2b55e 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -600,12 +600,12 @@ Py_FinalizeEx(void)
* XXX but I'm unclear on exactly how that one happens. In any case,
* XXX I haven't seen a real-life report of either of these.
*/
- PyGC_Collect();
+ _PyGC_CollectIfEnabled();
#ifdef COUNT_ALLOCS
/* With COUNT_ALLOCS, it helps to run GC multiple times:
each collection might release some types from the type
list, so they become garbage. */
- while (PyGC_Collect() > 0)
+ while (_PyGC_CollectIfEnabled() > 0)
/* nothing */;
#endif
/* Destroy all modules */
@@ -632,7 +632,7 @@ Py_FinalizeEx(void)
* XXX Python code getting called.
*/
#if 0
- PyGC_Collect();
+ _PyGC_CollectIfEnabled();
#endif
/* Disable tracemalloc after all Python objects have been destroyed,