We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d26769 commit e2166e3Copy full SHA for e2166e3
codeflash/code_utils/code_utils.py
@@ -119,7 +119,8 @@ def has_any_async_functions(code: str) -> bool:
119
120
def cleanup_paths(paths: list[Path]) -> None:
121
for path in paths:
122
- if path.is_dir():
123
- shutil.rmtree(path, ignore_errors=True)
124
- else:
125
- path.unlink(missing_ok=True)
+ if path and path.exists():
+ if path.is_dir():
+ shutil.rmtree(path, ignore_errors=True)
+ else:
126
+ path.unlink(missing_ok=True)
0 commit comments