Check Python version in install script
Add future imports for Python backward compatibility.
This commit is contained in:
parent
7101afc239
commit
2b27dd7903
12
install.py
12
install.py
@ -1,11 +1,23 @@
|
|||||||
#!/usr/bin/env python
|
#!/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 os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import os.path as p
|
import os.path as p
|
||||||
import glob
|
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_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
|
||||||
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
|
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user