scripts/coverage.py: s/exit/sys.exit/

the former is supposed to be used in "the interactive interpreter
shell and should not be used in programs.". this function
prints out its argument, and the exit code is 1. so just
print the error message using sys.exit()

see also
https://docs.python.org/3/library/sys.html#sys.exit and
https://docs.python.org/3/library/constants.html#exit

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2023-12-13 10:43:08 +08:00
parent 7600b68d5c
commit 1b57ba44eb

View File

@@ -134,8 +134,7 @@ def generate_coverage_report(path="build/coverage/test", name="tests", input_fil
maybe_print(f"Found {len(profraw_files)} input files")
if not profraw_files:
print("Error: couldn't find any raw profiling data files, can't generate coverage report")
exit(1)
sys.exit("Error: couldn't find any raw profiling data files, can't generate coverage report")
profdata_path = os.path.join(path, f"{name}.profdata")