Skip to content

Commit 8284c66

Browse files
committed
Fix issues with python 3.13
1 parent 32f922b commit 8284c66

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lean/components/util/path_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# limitations under the License.
1313

1414
from pathlib import Path
15+
from typing import Optional
1516

1617
from lean.components import reserved_names, output_reserved_names, forbidden_characters
1718
from lean.components.config.lean_config_manager import LeanConfigManager
@@ -29,13 +30,15 @@ def __init__(self, lean_config_manager: LeanConfigManager, platform_manager: Pla
2930
self._lean_config_manager = lean_config_manager
3031
self._platform_manager = platform_manager
3132

32-
def get_relative_path(self, destination: Path, source: Path = Path.cwd()) -> Path:
33+
def get_relative_path(self, destination: Path, source: Optional[Path] = None) -> Path:
3334
"""Returns a path relative to another one.
3435
3536
:param destination: the path to point to
3637
:param source: the root where the relative path is relative to
3738
:return: the destination path relative to the source path, or destination path if it is not relative
3839
"""
40+
if source is None:
41+
source = Path.cwd()
3942
try:
4043
return destination.relative_to(source)
4144
except ValueError:

0 commit comments

Comments
 (0)