Better python compatibility detection

This commit is contained in:
caryoscelus 2024-04-04 13:14:34 +00:00
parent b674737f99
commit 3db5e10882
No known key found for this signature in database
GPG key ID: 254EDDB85B66CB1F

View file

@ -6,11 +6,18 @@ from src.Config import config
# fix further imports from src dir # fix further imports from src dir
sys.modules['Config'] = sys.modules['src.Config'] sys.modules['Config'] = sys.modules['src.Config']
def pyReq():
major = sys.version_info.major
minor = sys.version_info.minor
if major < 3 or (major == 3 and minor < 8):
print("Error: Python 3.8+ is required")
sys.exit(0)
if major == 3 and minor < 11:
print(f"Python 3.11+ is recommended (you're running {sys.version})")
def launch(): def launch():
'''renamed from main to avoid clashes with main module''' '''renamed from main to avoid clashes with main module'''
if sys.version_info.major < 3: pyReq()
print("Error: Python 3.x is required")
sys.exit(0)
if '--silent' not in sys.argv: if '--silent' not in sys.argv:
from greet import fancy_greet from greet import fancy_greet