Skip to content

Commit

Permalink
Check that paths are on the same drive before calling relpath
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaCowley committed Oct 4, 2024
1 parent de2f36e commit d3a66ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user_docs/markdownTranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@


def prettyPathString(path: str) -> str:
cwd = os.getcwd()
if os.path.normcase(os.path.splitdrive(path)[0]) != os.path.normcase(os.path.splitdrive(cwd)[0]):
return path
return os.path.relpath(path, os.getcwd())


Expand Down

0 comments on commit d3a66ea

Please sign in to comment.