fix: IndexError in ensure_file_path_valid when file_path=os.getcwd()

This commit is contained in:
debugtalk
2020-06-14 20:18:58 +08:00
parent ca395b5820
commit f4382139db
2 changed files with 13 additions and 0 deletions

View File

@@ -199,6 +199,9 @@ def ensure_file_path_valid(file_path: Text) -> Text:
else:
raw_file_relative_name = raw_file_name
if raw_file_relative_name == "":
return file_path
path_names = []
for name in raw_file_relative_name.rstrip(os.sep).split(os.sep):