Skip to content

pathlib,assertion/rewrite: clean up some no longer needed code for importlib import mode#14379

Open
bluetech wants to merge 3 commits intopytest-dev:mainfrom
bluetech:importlib-cleanup
Open

pathlib,assertion/rewrite: clean up some no longer needed code for importlib import mode#14379
bluetech wants to merge 3 commits intopytest-dev:mainfrom
bluetech:importlib-cleanup

Conversation

@bluetech
Copy link
Copy Markdown
Member

Some cleanups we can do after merging #12313. Please see #12313 (review) for context and the commits for details.

There should not be a need to look at `module_path` in `find_spec`, only
at the `module_location`, i.e. the parent path of the module. It's not
needed for assertion rewrite (why would it? It's not supposed to be
special in this regard).

This was added in 28e1e25, seems that
commit did the right thing by removing `module_path` in the general
case, but for some reason kept it for the assertion rewrite meta path
finder.
….find_spec`

This was added in 9a444d1, but seems
like the real issue was fixed in
7ef1897, so this is no longer needed.
See also the previous commit.
@bluetech bluetech added the skip news used on prs to opt out of the changelog requirement label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant