File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -413,13 +413,19 @@ def _copy_files_needed_for_post_processing(
413413 destination_dir = f"{ output } /{ path_to_library } "
414414
415415 if Path (source_dir ).exists ():
416- shutil .copytree (
417- source_dir ,
418- destination_dir ,
419- dirs_exist_ok = True ,
420- )
421- # Apply headers only to the generator-input files copied above.
422- _add_header_to_files (destination_dir )
416+ with tempfile .TemporaryDirectory () as tmp_dir :
417+ shutil .copytree (
418+ source_dir ,
419+ tmp_dir ,
420+ dirs_exist_ok = True ,
421+ )
422+ # Apply headers only to the generator-input files copied above.
423+ _add_header_to_files (tmp_dir )
424+ shutil .copytree (
425+ tmp_dir ,
426+ destination_dir ,
427+ dirs_exist_ok = True ,
428+ )
423429
424430 # We need to create these directories so that we can copy files necessary for post-processing.
425431 os .makedirs (
You can’t perform that action at this time.
0 commit comments