Check for python version so we don't just fail out

This commit is contained in:
amcmanu3 2023-04-20 16:22:23 -04:00
parent 8b528993b5
commit ea9fec9971

11
main.py
View File

@ -27,6 +27,17 @@ if helper.check_root():
time.sleep(5)
Console.critical("Crafty shutting down. Root/Admin access denied.")
sys.exit(0)
if not sys.version_info.major == 3 and sys.version_info.minor >= 9:
Console.critical(
"Python version mismatch. Python "
f"{sys.version_info.major}.{sys.version_info.minor} detected"
"Crafty requires Python 3.9 or above. Please upgrade python."
)
time.sleep(5)
Console.critical("Crafty shutting down.")
time.sleep(3)
Console.info("Stopping Crafty.")
sys.exit(0)
# pylint: disable=wrong-import-position
try:
from app.classes.models.base_model import database_proxy