]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)
authorZachary Ware <zach@python.org>
Thu, 8 Sep 2022 18:52:07 +0000 (13:52 -0500)
committerGitHub <noreply@github.com>
Thu, 8 Sep 2022 18:52:07 +0000 (11:52 -0700)
Automerge-Triggered-By: GH:zware
Lib/test/libregrtest/utils.py

index 8578a028c78bc2946e33e3cc00e4681d3a968e7e..332dcc4c6db247f5fefe3ec1b5004b3ab05e9c22 100644 (file)
@@ -210,3 +210,10 @@ def clear_caches():
     else:
         for f in typing._cleanups:
             f()
+
+    try:
+        fractions = sys.modules['fractions']
+    except KeyError:
+        pass
+    else:
+        fractions._hash_algorithm.cache_clear()