diff --git a/scripts/accuraterip-checksum b/scripts/accuraterip-checksum index 9ad3999..52a5ade 100644 --- a/scripts/accuraterip-checksum +++ b/scripts/accuraterip-checksum @@ -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]) diff --git a/whipper/__main__.py b/whipper/__main__.py index 6a8e40b..98a11ae 100644 --- a/whipper/__main__.py +++ b/whipper/__main__.py @@ -2,7 +2,6 @@ # vi:si:et:sw=4:sts=4:ts=4 import os -import sys from whipper.command.main import main @@ -11,4 +10,4 @@ if __name__ == '__main__': # Make accuraterip_checksum be found automatically if it was built local_arb = os.path.join(os.path.dirname(__file__), '..', 'src') os.environ['PATH'] = ':'.join([os.getenv('PATH'), local_arb]) - sys.exit(main()) + raise SystemExit(main()) diff --git a/whipper/command/basecommand.py b/whipper/command/basecommand.py index 9831506..64be91c 100644 --- a/whipper/command/basecommand.py +++ b/whipper/command/basecommand.py @@ -3,7 +3,6 @@ import argparse import os -import sys from whipper.common import config, drive @@ -109,11 +108,11 @@ class BaseCommand: if hasattr(self, 'subcommands'): if not self.options.remainder: self.parser.print_help() - sys.exit(0) + raise SystemExit() if not self.options.remainder[0] in self.subcommands: logger.critical("incorrect subcommand: %s", self.options.remainder[0]) - sys.exit(1) + raise SystemExit(1) self.cmd = self.subcommands[self.options.remainder[0]]( self.options.remainder[1:], prog_name + " " + self.options.remainder[0], diff --git a/whipper/command/image.py b/whipper/command/image.py index a49b285..329f6c9 100644 --- a/whipper/command/image.py +++ b/whipper/command/image.py @@ -18,8 +18,6 @@ # You should have received a copy of the GNU General Public License # along with whipper. If not, see . -import sys - from whipper.command.basecommand import BaseCommand from whipper.common import accurip, config, program from whipper.extern.task import task @@ -63,7 +61,7 @@ Verifies the image from the given .cue files against the AccurateRip database. print('AccurateRip entry not found') accurip.print_report(prog.result) if not verified: - sys.exit(1) + raise SystemExit(1) class Image(BaseCommand):