diff options
author | Zachary Ware <zach@python.org> | 2022-09-08 18:52:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-08 18:52:07 (GMT) |
commit | 9c8f3794337457b1d905a9fa0f38c2978fe32abd (patch) | |
tree | 71fa7b53fb0f5cd98f7cbf2778085217d4cc325c | |
parent | c06c001b30849d8826132c288426f35403f8a47d (diff) | |
download | cpython-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.py | 7 |
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() |