]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Tue, 9 May 2023 12:33:36 +0000 (13:33 +0100)
committerGitHub <noreply@github.com>
Tue, 9 May 2023 12:33:36 +0000 (18:03 +0530)
Lib/test/libregrtest/utils.py

index fb13fa0e243ba7801861ee55cb852a839b7910b0..fd46819fd903fe49148a8ddf926ca4dde97426ea 100644 (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.