Skip to content

Commit 1c68a75

Browse files
committed
pythongh-96465: Clear fractions hash lru_cache under refleak testing
1 parent aa3b4cf commit 1c68a75

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/libregrtest/utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,10 @@ def clear_caches():
210210
else:
211211
for f in typing._cleanups:
212212
f()
213+
214+
try:
215+
fractions = sys.modules['fractions']
216+
except KeyError:
217+
pass
218+
else:
219+
fractions._hash_algorithm.cache_clear()

0 commit comments

Comments
 (0)