From 9f945a5dcd8ee1cd917f52e50a5a2fbc5a2ff88a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 24 Apr 2021 10:04:08 -0700 Subject: [PATCH] replace exit() with sys.exit() in Python files --- ci/generate-configuration-table.py | 4 ++-- tests/regression_tests/shapes/shapes.py | 4 ++-- tests/regression_tests/shapes/test_shapes.py | 2 +- tests/regression_tests/vuln/vuln.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/generate-configuration-table.py b/ci/generate-configuration-table.py index 00d2c0a49..74ac49b51 100755 --- a/ci/generate-configuration-table.py +++ b/ci/generate-configuration-table.py @@ -38,7 +38,7 @@ def main(): if opts.output_format.upper() not in supported_output_formats: sys.stderr.write(f"Error: {opts.output_format} output format is not supported\n") parser.print_help(file=sys.stderr) - exit(1) + sys.exit(1) if opts.colors == None: styles = { @@ -56,7 +56,7 @@ def main(): else: sys.stderr.write(f"Error: {opts.colors} color specification is illegal\n") parser.print_help(file=sys.stderr) - exit(1) + sys.exit(1) styles = { "Yes": f' style="color: {yes_color};"', "No": f' style="color: {no_color};"', diff --git a/tests/regression_tests/shapes/shapes.py b/tests/regression_tests/shapes/shapes.py index 28405d4af..43cf8cd45 100644 --- a/tests/regression_tests/shapes/shapes.py +++ b/tests/regression_tests/shapes/shapes.py @@ -89,7 +89,7 @@ def generate_shape_graph(shape, output_type): if process.wait() != 0: print(f"An error occurred while generating: {output_file}") - exit(1) + sys.exit(1) if output_type == "svg": # Remove the number in "Generated by graphviz version " @@ -119,4 +119,4 @@ print(f" Number of tests: {len(shapes) * len(output_types)}") print(f" Number of failures: {failures}") if not failures == 0: - exit(1) + sys.exit(1) diff --git a/tests/regression_tests/shapes/test_shapes.py b/tests/regression_tests/shapes/test_shapes.py index 734cdb339..9e235c880 100644 --- a/tests/regression_tests/shapes/test_shapes.py +++ b/tests/regression_tests/shapes/test_shapes.py @@ -91,7 +91,7 @@ def generate_shape_graph(shape, output_type): if process.wait() != 0: print(f"An error occurred while generating: {output_file}") - exit(1) + sys.exit(1) if output_type == "svg": # Remove the number in "Generated by graphviz version " diff --git a/tests/regression_tests/vuln/vuln.py b/tests/regression_tests/vuln/vuln.py index e170afceb..b8b5adde9 100644 --- a/tests/regression_tests/vuln/vuln.py +++ b/tests/regression_tests/vuln/vuln.py @@ -24,7 +24,7 @@ def generate_vuln_graph(vulnfile, output_type): if process.wait() < 0: print(f"An error occurred while generating: {output_file}") - exit(1) + sys.exit(1) failures = 0 for vulnfile in vulnfiles: @@ -39,4 +39,4 @@ print(f" Number of tests: {len(vulnfiles) * len(output_types)}") print(f" Number of failures: {failures}") if not failures == 0: - exit(1) + sys.exit(1) -- 2.40.0