Skip to content

Commit

Permalink
fix: Catch loading errors when loading additional modules during wild…
Browse files Browse the repository at this point in the history
…card expansion and alias resolution
  • Loading branch information
pawamoy committed May 7, 2024
1 parent 141460f commit 964e0d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/griffe/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def expand_wildcards(
continue
try:
self.load(package, try_relative_path=False)
except ImportError as error:
except (ImportError, LoadingError) as error:
logger.debug(f"Could not expand wildcard import {member.name} in {obj.path}: {error}")
continue

Expand Down Expand Up @@ -457,7 +457,7 @@ def resolve_module_aliases(
logger.debug(f"Failed to resolve alias {member.path} -> {target}")
try:
self.load(package, try_relative_path=False)
except ImportError as error:
except (ImportError, LoadingError) as error:
logger.debug(f"Could not follow alias {member.path}: {error}")
load_failures.add(package)
except CyclicAliasError as error:
Expand Down

0 comments on commit 964e0d2

Please sign in to comment.