bpo-44895: libregrtest: refleak check clears types later (GH-28113)

libregrtest now clears the type cache later to reduce the risk of
false alarm when checking for reference leaks. Previously, the type
cache was cleared too early and libregrtest raised a false alarm
about reference leaks under very specific conditions.

Move also support.gc_collect() outside clear/cleanup functions to
make the garbage collection more explicit.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Victor Stinner 2021-09-01 17:45:27 +02:00 committed by GitHub
parent 863154c929
commit 679cb4781e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 15 deletions

View file

@ -217,5 +217,3 @@ def clear_caches():
else:
for f in typing._cleanups:
f()
support.gc_collect()