From 964e0d2b78d3bc3530601009148fb4a5905b8721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 7 May 2024 23:44:49 +0200 Subject: [PATCH] fix: Catch loading errors when loading additional modules during wildcard expansion and alias resolution --- src/griffe/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/griffe/loader.py b/src/griffe/loader.py index 020830db..a585968c 100644 --- a/src/griffe/loader.py +++ b/src/griffe/loader.py @@ -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 @@ -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: