Skip to content

Commit

Permalink
return cached module
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jan 19, 2025
1 parent 4f7b4f8 commit d5f4a97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sphinx/ext/autodoc/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def unmangle(subject: Any, name: str) -> str | None:


def import_module(modname: str, try_reload: bool = False) -> Any:
if modname in sys.modules:
return sys.modules[modname]

original_module_names = frozenset(sys.modules)
try:
spec = find_spec(modname)
Expand Down

0 comments on commit d5f4a97

Please sign in to comment.