summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
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__)