Skip to content

Commit

Permalink
fix: Skip early submodules with dots in their path
Browse files Browse the repository at this point in the history
Issue #185: #185
  • Loading branch information
pawamoy committed Sep 1, 2023
1 parent 1bac3d6 commit 5e81b8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/griffe/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ def _load_submodules(self, module: Module) -> None:
self._load_submodule(module, subparts, subpath)

def _load_submodule(self, module: Module, subparts: tuple[str, ...], subpath: Path) -> None:
for subpart in subparts:
if "." in subpart:
logger.debug(f"Skip {subpath}, dots in filenames are not supported")
return
try:
parent_module = self._get_or_create_parent_module(module, subparts, subpath)
except UnimportableModuleError as error:
Expand All @@ -433,9 +437,6 @@ def _load_submodule(self, module: Module, subparts: tuple[str, ...], subpath: Pa
logger.debug(f"{error}. Missing __init__ module?")
return
submodule_name = subparts[-1]
if "." in submodule_name:
logger.debug(f"Skip {subpath}, dots in filenames are not supported")
return
try:
parent_module.set_member(
submodule_name,
Expand Down

0 comments on commit 5e81b8a

Please sign in to comment.