Skip to content

Commit

Permalink
Update previously missed submodule_path references
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost committed Oct 23, 2024
1 parent 28e13e9 commit a01c9da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions astroid/interpreter/_import/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,13 @@ def _find_spec(
if modpath:
if isinstance(finder, Finder):
search_paths = finder.contribute_to_path(spec, processed)
# If modname is a package from an editable install, update submodule_path
# If modname is a package from an editable install, update search_paths
# so that the next module in the path will be found inside of it using importlib.
# Existence of __name__ is guaranteed by _find_spec_with_path.
elif finder.__name__ in _EditableFinderClasses: # type: ignore[attr-defined]
search_paths = spec.submodule_search_locations

if spec.type == ModuleType.PKG_DIRECTORY:
spec = spec._replace(submodule_search_locations=submodule_path)
spec = spec._replace(submodule_search_locations=search_paths)

return spec

0 comments on commit a01c9da

Please sign in to comment.