Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,15 +47,11 @@

try:
import pystray
except:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you changing which exceptions are caught? This will likely cause issues eventually as the code changes overtime, especially since this is close to the top-level of the program.

except ImportError:
pass
except:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

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
Expand Down