Skip to content

Commit

Permalink
Catch AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Aug 23, 2022
1 parent c435403 commit 5490e2d
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 @@ -372,9 +372,9 @@ def _find_spec_with_path(
if spec:
try:
module_type = _MetaPathFinderModuleTypes[
meta_finder.__name__ # type: ignore[attr-defined]
meta_finder.__name__ # type: ignore[attr-defined], caught by AttributeError
]
except KeyError:
except (KeyError, AttributeError):
# If we don't recognise the finder, we assume it's a regular module
module_type = ModuleType.PY_SOURCE
return ( # type: ignore[return-value]
Expand Down

0 comments on commit 5490e2d

Please sign in to comment.