From c48e1dbb1e24fd48c40378ec4e31bb922e04c5e9 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Mon, 12 Apr 2021 06:52:27 +0200 Subject: [PATCH] use sys.exit() as exit might not be defined under windows -- see #94 --- src/img2pdf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 7d26094..a767ec7 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -3618,7 +3618,7 @@ and left/right, respectively. It is not possible to specify asymmetric borders. try: args.images = [sys.stdin.buffer.read()] except KeyboardInterrupt: - exit(0) + sys.exit(0) # with the number of pages being equal to the number of images, the # value passed to --viewer-initial-page must be between 1 and that number @@ -3629,14 +3629,14 @@ and left/right, respectively. It is not possible to specify asymmetric borders. "%s: error: argument --viewer-initial-page: must be " "greater than zero" % parser.prog ) - exit(2) + sys.exit(2) if args.viewer_initial_page > len(args.images): parser.print_usage(file=sys.stderr) logging.error( "%s: error: argument --viewer-initial-page: must be " "less than or equal to the total number of pages" % parser.prog ) - exit(2) + sys.exit(2) try: convert( @@ -3674,7 +3674,7 @@ and left/right, respectively. It is not possible to specify asymmetric borders. import traceback traceback.print_exc(file=sys.stderr) - exit(1) + sys.exit(1) if __name__ == "__main__":