pylint: Fix consider-using-sys-exit lint error
It's not recommended to use quit() or exit() outside of the interpreter,
because both of them rely on "site" module.
A better practice would be using sys.exit() which has the exact same behavior.
BUG=b:158811392
TEST=make lint && make test
Change-Id: I0e41ca5388a0659db4935b40b820c1b358fc94c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/2247965
Reviewed-by: Yilin Yang (kerker) <kerker@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
diff --git a/py/tools/yaml2json.py b/py/tools/yaml2json.py
index c0b073e..f68e48a 100755
--- a/py/tools/yaml2json.py
+++ b/py/tools/yaml2json.py
@@ -31,7 +31,7 @@
def main():
if not 1 < len(sys.argv) < 4:
- exit('Usage: %s input [output]' % sys.argv[0])
+ sys.exit('Usage: %s input [output]' % sys.argv[0])
in_file = sys.argv[1]
out_file = sys.argv[2] if len(sys.argv) > 2 else (
ConvertYAMLPathToJSONPath(in_file))