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
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue