Skip to content

Commit bfe9bb5

Browse files
committed
cleanup
1 parent 30d9cb4 commit bfe9bb5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

codeflash/code_utils/code_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from functools import lru_cache
77
from pathlib import Path
88
from tempfile import TemporaryDirectory
9+
import shutil
910

1011
from codeflash.cli_cmds.console import logger
1112

@@ -118,4 +119,7 @@ def has_any_async_functions(code: str) -> bool:
118119

119120
def cleanup_paths(paths: list[Path]) -> None:
120121
for path in paths:
121-
path.unlink(missing_ok=True)
122+
if path.is_dir():
123+
shutil.rmtree(path, ignore_errors=True)
124+
else:
125+
path.unlink(missing_ok=True)

0 commit comments

Comments
 (0)