]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() (GH-23044)
authorVictor Stinner <vstinner@python.org>
Fri, 30 Oct 2020 21:51:02 +0000 (22:51 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Oct 2020 21:51:02 +0000 (22:51 +0100)
commiteba5bf2f5672bf4861c626937597b85ac0c242b9
tree914219482fdbb19af1c54f1b6c9b81a67611c990
parent4fe72090deb7fb7bc09bfa56c92f6b3b0967d395
bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() (GH-23044)

The last GC collection is now done before clearing builtins and sys
dictionaries. Add also assertions to ensure that gc.collect() is no
longer called after _PyGC_Fini().

Pass also the tstate to PyInterpreterState_Clear() to pass the
correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().
Include/internal/pycore_interp.h
Modules/gcmodule.c
Python/pylifecycle.c
Python/pystate.c