Skip to content

Commit

Permalink
Fix bug in which non-relative paths do not work
Browse files Browse the repository at this point in the history
  • Loading branch information
parsiad committed Aug 18, 2024
1 parent 7d6d804 commit cbdb3ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nexus_autodl.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ def _select(self) -> None:
abspath = filedialog.askdirectory()
if not abspath:
return
relpath = str(Path(abspath).relative_to(Path.cwd()))
self._templates_path.set(relpath)
try:
path = str(Path(abspath).relative_to(Path.cwd()))
except ValueError:
path = abspath
self._templates_path.set(path)

def _start(self):
self._root.withdraw() # Close the current window
Expand Down

0 comments on commit cbdb3ae

Please sign in to comment.