diff options
author | Patrik Teivonen <patrik.teivonen@qt.io> | 2022-09-12 09:55:07 +0300 |
---|---|---|
committer | Patrik Teivonen <patrik.teivonen@qt.io> | 2022-10-12 11:05:12 +0000 |
commit | a99a1b1cc95f82841ad0d605d6db14522b3fa754 (patch) | |
tree | 0b9d42e9dd7d2a2fa53dbc7a868a02f66460e139 /packaging-tools/bld_openssl.py | |
parent | f32d14aa56c848ac3f1c8474cea0d2f1f4e58e29 (diff) |
Prefer raising SystemExit directly instead of importing sys.exit
Change-Id: I83330486be20cfecf673b8c8f395cbd1de6d1c43
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'packaging-tools/bld_openssl.py')
-rw-r--r-- | packaging-tools/bld_openssl.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/packaging-tools/bld_openssl.py b/packaging-tools/bld_openssl.py index 1c475dc5c..b7feb2a23 100644 --- a/packaging-tools/bld_openssl.py +++ b/packaging-tools/bld_openssl.py @@ -65,8 +65,7 @@ def check_environment() -> None: def check_cmd(cmd: List[str]) -> None: if subprocess.call(cmd, stdout=fnull, stderr=fnull) != 0: - print(f"*** Cannot execute {cmd[0]}") - sys.exit(1) + raise SystemExit(f"Check environment fail: {cmd[0]}") check_cmd(['nasm', '-h']) check_cmd(['nmake', '/?']) check_cmd(['7z']) @@ -89,8 +88,7 @@ def setup_argument_parser() -> argparse.ArgumentParser: def main() -> None: """Main""" if not platform.system().lower().startswith('win'): - print('*** Only Windows builds are supported.') - sys.exit(1) + raise SystemExit("Only Windows builds are supported.") check_environment() @@ -98,8 +96,7 @@ def main() -> None: args = parser.parse_args() if args.toolset not in ('VC-WIN32', 'VC-WIN64A'): - print('*** --toolset must be either VC-WIN32 or VC-WIN64A') - sys.exit(1) + raise SystemExit("--toolset must be either VC-WIN32 or VC-WIN64A") build(args.sourcedir, args.installdir, args.toolset) archive(args.installdir, args.archive_prefix) |