summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Ware <zach@python.org>2022-09-08 18:52:07 (GMT)
committerGitHub <noreply@github.com>2022-09-08 18:52:07 (GMT)
commit9c8f3794337457b1d905a9fa0f38c2978fe32abd (patch)
tree71fa7b53fb0f5cd98f7cbf2778085217d4cc325c
parentc06c001b30849d8826132c288426f35403f8a47d (diff)
downloadcpython-9c8f3794337457b1d905a9fa0f38c2978fe32abd.zip
cpython-9c8f3794337457b1d905a9fa0f38c2978fe32abd.tar.gz
cpython-9c8f3794337457b1d905a9fa0f38c2978fe32abd.tar.bz2
gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)
Automerge-Triggered-By: GH:zware
-rw-r--r--Lib/test/libregrtest/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index 8578a02..332dcc4 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -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()