Skip to content

Commit e2166e3

Browse files
committed
Update code_utils.py
1 parent 3d26769 commit e2166e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

codeflash/code_utils/code_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def has_any_async_functions(code: str) -> bool:
119119

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

0 commit comments

Comments
 (0)