File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -649,16 +649,14 @@ def determine_best_candidate(
649
649
if self .args .benchmark and benchmark_tree :
650
650
console .print (benchmark_tree )
651
651
console .rule ()
652
-
653
- self .write_code_and_helpers (
654
- self .function_to_optimize_source_code , original_helper_code , self .function_to_optimize .file_path
655
- )
656
652
except KeyboardInterrupt as e :
653
+ logger .exception (f"Optimization interrupted: { e } " )
654
+ raise
655
+ finally :
656
+ # reset for the next candidate
657
657
self .write_code_and_helpers (
658
658
self .function_to_optimize_source_code , original_helper_code , self .function_to_optimize .file_path
659
659
)
660
- logger .exception (f"Optimization interrupted: { e } " )
661
- raise
662
660
if not valid_optimizations :
663
661
return None
664
662
# need to figure out the best candidate here before we return best_optimization
You can’t perform that action at this time.
0 commit comments