fix: handle 'None' baseline values by defaulting to 0.0 in read_baseline
When a baseline file contains "None" as the best time (e.g. when no interpreter was available during baseline generation), the previous code attempted to parse it as float and failed. This change checks if the value starts with "None" and assigns 0.0 instead, allowing benchmarks without a valid baseline to proceed without crashing.
This commit is contained in:
+4
-1
@@ -288,7 +288,10 @@ def read_baseline():
|
||||
name, best = line.split(",")
|
||||
for benchmark in BENCHMARKS:
|
||||
if benchmark[0] == name:
|
||||
benchmark[2] = float(best)
|
||||
if not best.startswith("None"):
|
||||
benchmark[2] = float(best)
|
||||
else:
|
||||
benchmark[2] = 0.0
|
||||
|
||||
|
||||
def generate_baseline():
|
||||
|
||||
Reference in New Issue
Block a user