diff options
author | Louis Vézina <[email protected]> | 2019-09-05 11:30:14 -0400 |
---|---|---|
committer | Louis Vézina <[email protected]> | 2019-09-05 11:30:14 -0400 |
commit | dc510c71e376dc5a9ca28b54d6668573631734e6 (patch) | |
tree | fb375cab4acfc3087de5356fbf545ad589f16b3d | |
parent | b0c68c151fc5d9c6eb29e4b7c9c9cc9333e72776 (diff) | |
download | bazarr-dc510c71e376dc5a9ca28b54d6668573631734e6.tar.gz bazarr-dc510c71e376dc5a9ca28b54d6668573631734e6.zip |
Added a check for Python version.
-rw-r--r-- | bazarr.py | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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__) |