Commit cf9c610
pythongh-119584: Fix test_import Failed Assertion (pythongh-119623)
The fix in pythongh-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().
(cherry picked from commit ae7b176)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>1 parent bd9983c commit cf9c610
3 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2887 | 2887 | | |
2888 | 2888 | | |
2889 | 2889 | | |
| 2890 | + | |
2890 | 2891 | | |
2891 | 2892 | | |
2892 | 2893 | | |
2893 | 2894 | | |
2894 | 2895 | | |
2895 | 2896 | | |
| 2897 | + | |
| 2898 | + | |
2896 | 2899 | | |
2897 | 2900 | | |
2898 | 2901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
685 | 688 | | |
686 | 689 | | |
687 | 690 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| |||
2183 | 2183 | | |
2184 | 2184 | | |
2185 | 2185 | | |
2186 | | - | |
| 2186 | + | |
2187 | 2187 | | |
2188 | 2188 | | |
2189 | 2189 | | |
| |||
0 commit comments