Skip to content

Commit 13b0d19

Browse files
committed
Fixed single point of return code smell
1 parent 20dcff0 commit 13b0d19

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

kernel_tuner/file_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ def output_file_schema(target):
2323

2424
def get_configuration_validity(objective) -> str:
2525
""" Convert internal Kernel Tuner error to string """
26+
errorstring: str
2627
if not isinstance(objective, util.ErrorConfig):
27-
return "correct"
28+
errorstring = "correct"
2829
else:
2930
if isinstance(objective, util.CompilationFailedConfig):
30-
return "compile"
31+
errorstring = "compile"
3132
elif isinstance(objective, util.RuntimeFailedConfig):
32-
return "runtime"
33+
errorstring = "runtime"
3334
else:
34-
return "constraints"
35+
errorstring = "constraints"
36+
return errorstring
3537

3638

3739
def store_output_file(output_filename, results, tune_params, objective="time"):

0 commit comments

Comments
 (0)