Skip to content

Commit 344d1be

Browse files
authored
CM-23325 - Fix is_sub_path function for different drivers (#115)
1 parent 09aa709 commit 344d1be

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cycode/cli/utils/path_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ def get_relevant_files_in_path(path: str, exclude_patterns: Iterable[str]) -> Li
2222

2323

2424
def is_sub_path(path: str, sub_path: str) -> bool:
25-
common_path = os.path.commonpath([get_absolute_path(path), get_absolute_path(sub_path)])
26-
return path == common_path
25+
try:
26+
common_path = os.path.commonpath([get_absolute_path(path), get_absolute_path(sub_path)])
27+
return path == common_path
28+
except ValueError:
29+
# if paths are on the different drives
30+
return False
2731

2832

2933
def get_absolute_path(path: str) -> str:

0 commit comments

Comments
 (0)