Skip to content

Commit 9de664b

Browse files
committed
improved file removal after errors
1 parent 4a24f2c commit 9de664b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

codeflash/optimization/optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ def run(self) -> None:
127127
logger.info("Information on existing benchmarks will not be available for this run.")
128128
finally:
129129
# Restore original source code
130+
trace_file.unlink()
131+
shutil.rmtree(self.replay_tests_dir, ignore_errors=True)
130132
for file in file_path_to_source_code:
131133
with file.open("w", encoding="utf8") as f:
132134
f.write(file_path_to_source_code[file])
133-
134135
optimizations_found: int = 0
135136
function_iterator_count: int = 0
136137
if self.args.test_framework == "pytest":

0 commit comments

Comments
 (0)