Skip to content

Commit 0ab91a9

Browse files
committed
[script] fix when run dir is not found
1 parent 5a9fa88 commit 0ab91a9

File tree

1 file changed

+4
-5
lines changed
  • vtr_flow/scripts/python_libs/vtr

1 file changed

+4
-5
lines changed

vtr_flow/scripts/python_libs/vtr/util.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,11 @@ def get_latest_run_dir(base_dir):
540540
"""
541541
latest_run_dir_name = get_latest_run_dir_name(base_dir)
542542

543-
if latest_run_dir_name is None:
543+
if latest_run_dir_name:
544+
return str(PurePath(base_dir) / latest_run_dir_name)
545+
else:
544546
return None
545547

546-
return str(PurePath(base_dir) / latest_run_dir_name)
547-
548-
549548
def get_existing_run_dir(base_dir: str, run_dir: str) -> str:
550549
"""
551550
Get an existing run directory (from a previous run). Throw if it doesn't exist
@@ -585,7 +584,7 @@ def get_latest_run_dir_name(base_dir):
585584

586585
if not run_dir.exists():
587586
# No existing run directories
588-
return None
587+
return ""
589588

590589
while run_dir.exists():
591590
run_number += 1

0 commit comments

Comments
 (0)