gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320)

This commit is contained in:
Alex Waygood 2023-05-09 13:33:36 +01:00 committed by GitHub
parent 41aff464ce
commit 9196da417d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -210,6 +210,13 @@ def clear_caches():
else:
fractions._hash_algorithm.cache_clear()
try:
inspect = sys.modules['inspect']
except KeyError:
pass
else:
inspect._shadowed_dict_from_mro_tuple.cache_clear()
def get_build_info():
# Get most important configure and build options as a list of strings.