Replace 'sys.exit()' and 'exit()' instructions with 'SystemExit()' equivalents

- `SystemExit` doesn't require importing the `sys` module
- `exit()` depends on the `site` module (for this reason its usage is discouraged in production code)

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2020-05-30 09:38:42 +00:00
parent 8802c5482e
commit fa7c50d3a6
4 changed files with 6 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import sys
if len(sys.argv) == 2 and sys.argv[1] == '--version':
print('accuraterip-checksum version 2.0')
exit(0)
raise SystemExit()
use_v1 = None
if len(sys.argv) == 4:
@@ -22,7 +22,7 @@ elif len(sys.argv) == 5:
if use_v1 is None:
print('Syntax: accuraterip-checksum [--version / --accuraterip-v1 / --accuraterip-v2 (default)] filename track_number total_tracks')
exit(1)
raise SystemExit(1)
filename = sys.argv[offset + 1]
track_number = int(sys.argv[offset + 2])