From 8ac7dde68e68c0b4a0c92b95c2e8a2445f3f78b5 Mon Sep 17 00:00:00 2001 From: Anish Adamane <93029923+GeniusPlums@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:48:40 +0530 Subject: [PATCH] Update main.py --- main.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 0402f6e7..d4042051 100755 --- a/main.py +++ b/main.py @@ -27,12 +27,9 @@ import sys MIN_PYTHON = (3, 8) + if sys.version_info < MIN_PYTHON: - print("[ERROR] Python %s.%s or later is required." % MIN_PYTHON) - try: - sys.exit(0) - except: - os._exit(0) + sys.exit("[ERROR] Python %s.%s or later is required." % MIN_PYTHON) try: import atexit @@ -50,15 +47,11 @@ try: import pystray - except: + except ImportError: pass -except: - print( +except ImportError: + sys.exit( "[ERROR] Python dependencies not installed. Please follow start guide: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-how-to-start") - try: - sys.exit(0) - except: - os._exit(0) from library.log import logger import library.scheduler as scheduler