Skip to content

Commit

Permalink
editor: Handle ValueErrors in os.path.relpath()
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Sep 18, 2018
1 parent 9bb1494 commit 4c24ee3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ReText/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ def getImageFilenameAndLink(self):
if chosenFileName:
# Use relative links for named documents
if self.tab.fileName:
link = os.path.relpath(chosenFileName, saveDir)
try:
link = os.path.relpath(chosenFileName, saveDir)
except ValueError: # different roots
link = chosenFileName
else:
link = chosenFileName
else:
Expand Down

0 comments on commit 4c24ee3

Please sign in to comment.