Skip to content

Commit

Permalink
chore: Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 29, 2024
1 parent b065d15 commit 7331bad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/griffe/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ def _load_extension(
# Force path to be a string, as it could have been passed from `mkdocs.yml`,
# using the custom YAML tag `!relative`, which gives an instance of MkDocs
# path placeholder classes, which are not iterable.
# See https://github.com/mkdocs/mkdocs/issues/3414.
# TODO: Update when this issue is resolved.
import_path = str(import_path)

# Otherwise we consider it's an import path, without options.
Expand All @@ -407,6 +405,7 @@ def _load_extension(

# If the import path contains a colon, we split into path and class name.
colons = import_path.count(":")
# Special case for The Annoying Operating System.
if colons > 1 or (colons and ":" not in Path(import_path).drive):
import_path, extension_name = import_path.rsplit(":", 1)
else:
Expand Down Expand Up @@ -446,7 +445,7 @@ def _load_extension(
f"Extension module '{import_path}' has no '{extension_name}' attribute",
) from error

# No class name was specified so we search all extension classes in the module
# No class name was specified so we search all extension classes in the module,
# instantiate each with the same options, and return them.
extensions = []
for obj in vars(ext_object).values():
Expand Down

0 comments on commit 7331bad

Please sign in to comment.