Skip to content

Commit 5a5b639

Browse files
committed
Add code to check if the about_file path is valid or invalid. If the path is invalid, the tool will log the error and skip this generation and keep continue with the rest.
1 parent 5182b56 commit 5a5b639

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

about_code_tool/genabout.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,14 @@ def pre_generation(self, gen_location, input_list, action_num):
516516
about_file_location = join(gen_location, file_location)
517517
about_file_dir = dirname(about_file_location)
518518
if not os.path.exists(about_file_dir):
519-
makedirs(about_file_dir)
519+
# Check for invalid file path
520+
try:
521+
makedirs(about_file_dir)
522+
except:
523+
msg = 'Invalid ABOUT file path.'
524+
self.errors.append(Error(VALUE, 'about_file_path',
525+
about_file_dir, msg))
526+
continue
520527
about_file_exist = _exists(about_file_location)
521528
if about_file_exist:
522529
if action_num == ACTION_DO_NOTHING_IF_ABOUT_FILE_EXIST:

0 commit comments

Comments
 (0)