Skip to content

Commit a9f300a

Browse files
committed
Fix ensure_directory to handle empty strings
When save_path is a filename without directory, os.dirname(save_path) is an empty string and ensure_directory fails. This adds a check if the directory variable contains an empty string before running os.makedirs.
1 parent 07210a0 commit a9f300a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

acestep/pipeline_ace_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
def ensure_directory_exists(directory):
8484
directory = str(directory)
85-
if not os.path.exists(directory):
85+
if directory and not os.path.exists(directory):
8686
os.makedirs(directory)
8787

8888

0 commit comments

Comments
 (0)