diff options
Diffstat (limited to 'astroid')
-rw-r--r-- | astroid/interpreter/_import/spec.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 1630ca8a..b1f8e8db 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -393,7 +393,7 @@ def _find_spec_with_path( # "type" as their __class__.__name__. We check __name__ as well # to see if we can support the finder. try: - meta_finder_name = meta_finder.__name__ + meta_finder_name = meta_finder.__name__ # type: ignore[attr-defined] except AttributeError: continue if meta_finder_name not in _MetaPathFinderModuleTypes: @@ -461,7 +461,8 @@ def find_spec(modpath: list[str], path: Sequence[str] | None = None) -> ModuleSp submodule_path = finder.contribute_to_path(spec, processed) # If modname is a package from an editable install, update submodule_path # so that the next module in the path will be found inside of it using importlib. - elif finder.__name__ in _EditableFinderClasses: + # Existence of __name__ is guaranteed by _find_spec_with_path. + elif finder.__name__ in _EditableFinderClasses: # type: ignore[attr-defined] submodule_path = spec.submodule_search_locations if spec.type == ModuleType.PKG_DIRECTORY: |