From 02ffa61ea589b7daf092c616342cc14f37eb23af Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Tue, 12 Nov 2024 14:00:29 +0100 Subject: [PATCH] debug --- tests/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index b34c502e..9ef8a33e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -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: @@ -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)