Skip to content

Commit 5cf57ad

Browse files
authored
Merge branch 'main' into limit-benchmark-looping
2 parents 7821a30 + fdd7ca9 commit 5cf57ad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,13 @@ def line_profiler_step(
20442044
self.write_code_and_helpers(
20452045
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
20462046
)
2047+
# this will happen when a timeoutexpired exception happens
2048+
if isinstance(line_profile_results, TestResults) and not line_profile_results.test_results:
2049+
logger.warning(
2050+
f"Timeout occurred while running line profiler for original function {self.function_to_optimize.function_name}"
2051+
)
2052+
# set default value for line profiler results
2053+
return {"timings": {}, "unit": 0, "str_out": ""}
20472054
if line_profile_results["str_out"] == "":
20482055
logger.warning(
20492056
f"Couldn't run line profiler for original function {self.function_to_optimize.function_name}"

0 commit comments

Comments
 (0)