From cbdb3ae371daa059ef4cd2de82a608bec92a3055 Mon Sep 17 00:00:00 2001 From: Parsiad Azimzadeh Date: Sun, 18 Aug 2024 19:02:15 -0400 Subject: [PATCH] Fix bug in which non-relative paths do not work --- nexus_autodl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nexus_autodl.py b/nexus_autodl.py index fe8fd01..aa74e61 100644 --- a/nexus_autodl.py +++ b/nexus_autodl.py @@ -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