mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-13 22:18:36 +08:00
[None][chore] always try-catch when clear build folder in build_wheel.py (#6748)
Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
This commit is contained in:
parent
5145e9d40e
commit
7e33ed6d61
@ -68,13 +68,13 @@ def get_build_dir(build_dir, build_type):
|
||||
def clear_folder(folder_path):
|
||||
for item in os.listdir(folder_path):
|
||||
item_path = os.path.join(folder_path, item)
|
||||
if os.path.isdir(item_path) and not os.path.islink(item_path):
|
||||
rmtree(item_path)
|
||||
else:
|
||||
try:
|
||||
try:
|
||||
if os.path.isdir(item_path) and not os.path.islink(item_path):
|
||||
rmtree(item_path)
|
||||
else:
|
||||
os.remove(item_path)
|
||||
except (OSError, IOError) as e:
|
||||
print(f"Failed to remove {item_path}: {e}", file=sys.stderr)
|
||||
except (OSError, IOError) as e:
|
||||
print(f"Failed to remove {item_path}: {e}", file=sys.stderr)
|
||||
|
||||
|
||||
def sysconfig_scheme(override_vars=None):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user