Skip to content

Commit 1ab600b

Browse files
authored
Merge pull request #149 from hsorby/main
Handle common paths not being on the same drive.
2 parents 119b611 + e4036f8 commit 1ab600b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mapclient/view/workflow/workflowwidget.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,13 @@ def _recent_workflow_paths(self):
750750
if len(group) == 1:
751751
directory_map[workflow_path] = directory_name
752752
else:
753-
common_prefix = os.path.commonpath(group)
754-
unique_name = os.path.relpath(workflow_path, common_prefix)
753+
try:
754+
common_prefix = os.path.commonpath(group)
755+
unique_name = os.path.relpath(workflow_path, common_prefix)
756+
except ValueError:
757+
# If the common path cannot be determined, use the full path.
758+
unique_name = workflow_path
759+
755760
directory_map[workflow_path] = unique_name
756761

757762
return directory_map

0 commit comments

Comments
 (0)