Better python compatibility detection
This commit is contained in:
parent
b674737f99
commit
3db5e10882
1 changed files with 10 additions and 3 deletions
13
zeronet.py
13
zeronet.py
|
@ -6,11 +6,18 @@ from src.Config import config
|
|||
# fix further imports from src dir
|
||||
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():
|
||||
'''renamed from main to avoid clashes with main module'''
|
||||
if sys.version_info.major < 3:
|
||||
print("Error: Python 3.x is required")
|
||||
sys.exit(0)
|
||||
pyReq()
|
||||
|
||||
if '--silent' not in sys.argv:
|
||||
from greet import fancy_greet
|
||||
|
|
Loading…
Reference in a new issue