Skip to content

Commit

Permalink
refactor: Always add import path of module to inspect when it has a f…
Browse files Browse the repository at this point in the history
…ile path
  • Loading branch information
pawamoy committed Jun 16, 2023
1 parent 3ea37ba commit 4021e6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/griffe/agents/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ def inspect(
Returns:
The module, with its members populated.
"""
if not import_paths and filepath:
import_paths = [filepath.parent]
import_paths = import_paths or []
if filepath and filepath.parent not in import_paths:
import_paths.insert(0, filepath.parent)
return Inspector(
module_name,
filepath,
Expand Down

0 comments on commit 4021e6f

Please sign in to comment.