code cleanup: use exist_ok keyword arg to os.makedirs() rather then checking if the dir exists first.
This commit is contained in:
@@ -436,10 +436,7 @@ def path_reference_copy(copy_set, report=print):
|
||||
pass
|
||||
else:
|
||||
dir_to = os.path.dirname(file_dst)
|
||||
|
||||
if not os.path.isdir(dir_to):
|
||||
os.makedirs(dir_to)
|
||||
|
||||
os.makedirs(dir_to, exist_ok=True)
|
||||
shutil.copy(file_src, file_dst)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user