From ed326564a5d1cf23e47ae47f3a9523c629830bfd Mon Sep 17 00:00:00 2001 From: Jason Milkins Date: Sun, 4 Feb 2024 10:05:47 +0700 Subject: [PATCH] use sys.exit --- slideshow.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slideshow.py b/slideshow.py index cbe711a..2a37649 100755 --- a/slideshow.py +++ b/slideshow.py @@ -528,7 +528,7 @@ def on_key_release(symbol, modifiers): if key.Q == symbol or key.ESCAPE == symbol: window.close() - pyglet.app.exit() + sys.exit() elif key.SPACE == symbol: toggle_pause() @@ -659,7 +659,7 @@ def on_resize(width,height): if args_dir and args_dir == '-h' or args_dir == '--help;': print(help_usage, file=sys.stderr) - exit(0) + sys.exit(0) if args_dir: @@ -672,7 +672,7 @@ def on_resize(width,height): if len(image_paths) < 1: print(f"No images found in source", file=sys.stderr) - exit(1) + sys.exit(1) else: saved_image_paths = image_paths.copy() image_filename = image_paths[image_index] @@ -726,4 +726,4 @@ def on_resize(width,height): print("There was an error") print(e) - quit() + sys.exit()