Skip to content

Commit

Permalink
Update module_loader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
supercoder-dev authored Jun 12, 2024
1 parent 43ee1a6 commit 54899a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litestar/utils/module_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def module_to_os_path(dotted_path: str = "app") -> Path:
except ModuleNotFoundError as e:
raise TypeError(f"Couldn't find the path for {dotted_path}") from e

return Path(str(src.origin).rsplit(os.path.sep + "__init__.py", maxsplit=1)[0])
path = Path(src.origin)
return path.parent if path.is_file() else path


def import_string(dotted_path: str) -> Any:
Expand Down

0 comments on commit 54899a8

Please sign in to comment.