Skip to content

Commit 9c8f379

Browse files
authored
gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)
Automerge-Triggered-By: GH:zware
1 parent c06c001 commit 9c8f379

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)