Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-108822: Fix regrtest clear_caches() #109432

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 14, 2023

Python 3.11 doesn't have fractions._hash_algorithm cache.

Python 3.11 doesn't have fractions._hash_algorithm cache.
@vstinner
Copy link
Member Author

Without this change, ./python -m test test_buffer -R 3:3 fails with:

test test_buffer crashed -- Traceback (most recent call last):
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/runtest.py", line 391, in _runtest_env_changed_exc
    _load_run_test(result, ns)
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/runtest.py", line 351, in _load_run_test
    regrtest_runner(result, test_func, ns)
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/runtest.py", line 306, in regrtest_runner
    refleak, test_result = dash_R(ns, result.test_name, test_func)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/refleak.py", line 87, in dash_R
    dash_R_cleanup(fs, ps, pic, zdc, abcs)
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/refleak.py", line 182, in dash_R_cleanup
    clear_caches()
  File "/home/vstinner/python/3.11/Lib/test/libregrtest/utils.py", line 220, in clear_caches
    fractions._hash_algorithm.cache_clear()
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'fractions' has no attribute '_hash_algorithm'

test_buffer failed (uncaught exception)

@vstinner vstinner enabled auto-merge (squash) September 14, 2023 23:44
@vstinner vstinner merged commit 7a20797 into python:3.11 Sep 15, 2023
@vstinner vstinner deleted the regrtest_refleak_311 branch September 15, 2023 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant