Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Nov 12, 2024
1 parent a1090e5 commit 02ffa61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def recursive_chmod(path: str, mode: int):
recursive_chmod(full_path, mode)

def on_error(func, path, exc_info):
if not Path(path).exists():
print("path does not exist", path)
return
exc_type, exc_value, exc_traceback = exc_info

# Example usage:
Expand All @@ -50,7 +53,7 @@ def last_resort(func, path, exc_info):
print("Traceback: ", traceback.format_tb(exc_traceback))

recursive_chmod(path, 0o755)
shutil.rmtree(model_dir, onerror=last_resort)
shutil.rmtree(path, onerror=last_resort)

if isinstance(model_dir, str):
model_dir = Path(model_dir)
Expand Down

0 comments on commit 02ffa61

Please sign in to comment.