diff --git a/scripts/pyi_generator.py b/scripts/pyi_generator.py index cd0a5f551..98f87456d 100644 --- a/scripts/pyi_generator.py +++ b/scripts/pyi_generator.py @@ -95,7 +95,9 @@ def _relative_to_pwd(path: Path) -> Path: Returns: The relative path. """ - return path.relative_to(PWD) + if path.is_absolute(): + return path.relative_to(PWD) + return path def _git_diff(args: list[str]) -> str: