Преглед изворни кода

Fix pyi_generator relative path determination (#2485)

Masen Furer пре 1 година
родитељ
комит
2782c0fe3c
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      scripts/pyi_generator.py

+ 3 - 1
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: