]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119584: Fix test_import Failed Assertion (gh-119623)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 27 May 2024 19:35:30 +0000 (15:35 -0400)
committerGitHub <noreply@github.com>
Mon, 27 May 2024 19:35:30 +0000 (19:35 +0000)
commitae7b17673f29efe17b416cbcfbf43b5b3ff5977c
tree67d022f5a1d5b2df3c3721914c340433a79cce7d
parent0bd0d4072a49df49a88e8b02c3258dbd294170f6
gh-119584: Fix test_import Failed Assertion (gh-119623)

The fix in gh-119561 introduced an assertion that doesn't hold true if any of the three new test extension modules are loaded more than once.  This is fine normally but breaks if the new test_check_state_first() is run more than once, which happens for refleak checking and with the regrtest --forever flag.  We fix that here by clearing each of the three modules after loading them.  We also tweak a check in _modules_by_index_check().
Lib/test/test_import/__init__.py
Modules/_testsinglephase.c
Python/import.c