summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2019-09-05 11:30:14 -0400
committerLouis Vézina <[email protected]>2019-09-05 11:30:14 -0400
commitdc510c71e376dc5a9ca28b54d6668573631734e6 (patch)
treefb375cab4acfc3087de5356fbf545ad589f16b3d /bazarr.py
parentb0c68c151fc5d9c6eb29e4b7c9c9cc9333e72776 (diff)
downloadbazarr-dc510c71e376dc5a9ca28b54d6668573631734e6.tar.gz
bazarr-dc510c71e376dc5a9ca28b54d6668573631734e6.zip
Added a check for Python version.
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/bazarr.py b/bazarr.py
index 5e559fe03..17fc44cdf 100644
--- a/bazarr.py
+++ b/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__)