mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 13:35:18 +00:00
Added a check for Python version.
This commit is contained in:
parent
b0c68c151f
commit
dc510c71e3
1 changed files with 18 additions and 1 deletions
19
bazarr.py
19
bazarr.py
|
@ -4,10 +4,27 @@ import subprocess as sp
|
|||
import time
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
from bazarr import libs
|
||||
from bazarr.get_args import args
|
||||
|
||||
|
||||
def check_python_version():
|
||||
python_version = platform.python_version_tuple()
|
||||
minimum_python_version_tuple = (2, 7, 13)
|
||||
minimum_python_version = ".".join(str(i) for i in minimum_python_version_tuple)
|
||||
|
||||
if int(python_version[0]) > minimum_python_version_tuple[0]:
|
||||
print "Python 3 isn't supported. Please use Python " + minimum_python_version + " or greater."
|
||||
os._exit(0)
|
||||
|
||||
elif int(python_version[1]) < minimum_python_version_tuple[1] or int(python_version[2]) < minimum_python_version_tuple[2]:
|
||||
print "Python " + minimum_python_version + " or greater required. Current version is " + platform.python_version() + ". Please upgrade Python."
|
||||
os._exit(0)
|
||||
|
||||
|
||||
check_python_version()
|
||||
|
||||
dir_name = os.path.dirname(__file__)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue