File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -645,11 +645,18 @@ def filter_ids(dest_list, label):
645645 gcstamp = build_dir / '.gcstamp'
646646 for bdir_file in build_dir .iterdir ():
647647 if bdir_file .is_dir () and bdir_file .name not in ('logs' , 'tests' ):
648- shutil .rmtree (bdir_file )
648+ try :
649+ shutil .rmtree (bdir_file )
650+ except Exception :
651+ _logger .exception ('Failed to remove %s' , bdir_file )
649652 elif bdir_file .name == 'logs' :
650653 for log_file_path in bdir_file .iterdir ():
651654 if log_file_path .is_dir ():
652- shutil .rmtree (log_file_path )
655+
656+ try :
657+ shutil .rmtree (log_file_path )
658+ except Exception :
659+ _logger .exception ('Failed to remove %s' , log_file_path )
653660 elif log_file_path .name in ('run.txt' , 'wake_up.txt' ) or not log_file_path .name .endswith ('.txt' ):
654661 log_file_path .unlink ()
655662 gcstamp .write_text (f'gc date: { datetime .datetime .now ()} ' )
You can’t perform that action at this time.
0 commit comments