File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1986,7 +1986,17 @@ def clear_component_cache(self, component):
19861986
19871987 if os .path .exists (sam_dir ):
19881988 self .log_verbose (f"Clearing entire SAM cache for { component } : { sam_dir } " )
1989- shutil .rmtree (sam_dir )
1989+ try :
1990+ shutil .rmtree (sam_dir )
1991+ except (FileNotFoundError , OSError ) as e :
1992+ self .log_verbose (
1993+ f"Warning: Error clearing SAM cache (may already be deleted): { e } "
1994+ )
1995+ # Try alternative cleanup method for broken symlinks
1996+ try :
1997+ subprocess .run (["rm" , "-rf" , sam_dir ], check = False )
1998+ except Exception as e2 :
1999+ self .log_verbose (f"Alternative cleanup also failed: { e2 } " )
19902000
19912001 def _validate_python_syntax (self , directory ):
19922002 """Validate Python syntax in all .py files in the directory"""
@@ -2042,7 +2052,7 @@ def build_lib_package(self):
20422052 raise Exception ("Python syntax validation failed" )
20432053
20442054 result = subprocess .run (
2045- ["python" , "setup.py" , "build" ],
2055+ [sys . executable , "setup.py" , "build" ],
20462056 cwd = lib_dir ,
20472057 capture_output = True ,
20482058 text = True ,
You can’t perform that action at this time.
0 commit comments