From 2b27dd7903196d1aa96733d20256197eddcd5f0c Mon Sep 17 00:00:00 2001 From: micbou Date: Thu, 16 Jun 2016 10:55:32 +0200 Subject: [PATCH] Check Python version in install script Add future imports for Python backward compatibility. --- install.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install.py b/install.py index e5063e2f..36bb70e2 100755 --- a/install.py +++ b/install.py @@ -1,11 +1,23 @@ #!/usr/bin/env python +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals +from __future__ import absolute_import + import os import subprocess import sys import os.path as p import glob +PY_MAJOR, PY_MINOR = sys.version_info[ 0 : 2 ] +if not ( ( PY_MAJOR == 2 and PY_MINOR >= 6 ) or + ( PY_MAJOR == 3 and PY_MINOR >= 3 ) or + PY_MAJOR > 3 ): + sys.exit( 'YouCompleteMe requires Python >= 2.6 or >= 3.3; ' + 'your version of Python is ' + sys.version ) + DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) ) DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )