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/utils/pygpt.py b/py/utils/pygpt.py
index bd60abf..3079f02 100755
--- a/py/utils/pygpt.py
+++ b/py/utils/pygpt.py
@@ -1628,7 +1628,7 @@
except Exception as e:
if args.verbose or args.debug:
logging.exception('Failure in command [%s]', args.command)
- exit('ERROR: %s: %s' % (args.command, str(e) or 'Unknown error.'))
+ sys.exit('ERROR: %s: %s' % (args.command, str(e) or 'Unknown error.'))
if __name__ == '__main__':